Removing extra spacing around QWidget

后端 未结 2 1142
暖寄归人
暖寄归人 2020-12-16 19:28

How to remove extra spacing around QWidget?

Here\'s the simple example. The widget\'s space is grey; you see, there\'s some space (about 0.3-0.4 cm) around the conte

相关标签:
2条回答
  • 2020-12-16 20:07

    Change the contents margins of the layout you added the QWidget to and any other layout you wish to change by using the method setContentsMargins().

    0 讨论(0)
  • 2020-12-16 20:22

    There are two functions that you can use to get rid of all the spacing in your layout:

    1)QLayout::setMargin(0)
    2)QLayout::setSpacing(0)
    
    0 讨论(0)
提交回复
热议问题