设置样式表中的内容边距 [英] Set content margins from stylesheet

查看:149
本文介绍了设置样式表中的内容边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力用样式表将Qt中QLayout对象的内容边距设置为零.我可以使用QLayout::setContentsMargins(0, 0, 0, 0)删除它们,但我希望从样式表中删除它们.

I'm struggling to set content margins to zero from QLayout objects in Qt with a stylesheet. I can remove them with QLayout::setContentsMargins(0, 0, 0, 0) but I would prefer to do it from stylesheet.

推荐答案

到目前为止,这还无法实现.使用

As of now this cannot be achieved. Use

QLayout::setContentsMargins(0, 0, 0, 0)

QLayout::setSpacing(0)

如果您还想消除小部件之间的空间.

if you also want to eliminate the space between widgets.

另请参见此错误报告用于QLayout对象的样式表控件 到目前为止尚未解决.

See also this bug report Stylesheet controls for QLayout objects which is unresolved so far.

这篇关于设置样式表中的内容边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆