QDialog中QToolButton的间距
我有一个QToolButton的QDialog。所有QToolButton在QHBoxLayout中成对分组,然后作为最终布局添加到QVBoxLayout中 我已经使用QVBoxLayout.spacing(0)删除了间距,但是我仍然看到QDialog的边框和QToolButton之间有空白。QDialog中QToolButton的间距,qt,layout,qdialog,Qt,Layout,Qdialog,我有一个QToolButton的QDialog。所有QToolButton在QHBoxLayout中成对分组,然后作为最终布局添加到QVBoxLayout中 我已经使用QVBoxLayout.spacing(0)删除了间距,但是我仍然看到QDialog的边框和QToolButton之间有空白。 我尝试将样式表的填充和边距设置为零(对于QDialog)以及te setContentMargin(0,0,0,0)。什么都不管用。还有其他方法吗?谢谢。你试过为你的按钮设置大小策略吗?是的,但没有任何变
我尝试将样式表的填充和边距设置为零(对于QDialog)以及te setContentMargin(0,0,0,0)。什么都不管用。还有其他方法吗?谢谢。你试过为你的按钮设置大小策略吗?是的,但没有任何变化,我一直有很多空白。请尝试使用
QWidget::setContentsMargins(int,int,int,int),为你的QToolButton
s设置零边距。
我刚刚试过在主布局上设置ContentsMargins(int,int,int,int)(在set布局中声明的一个)它成功了。谢谢。