在PyQt中设置布局边距

11
在 Qt Designer 中,我可以通过属性 layout*Margin 设置 VBox 或 HBox 的边距。
那么在 pyqt 中该怎么做呢?
1个回答

27

您可以使用QLayout.setContentsMargins

# layout is a defined VBox or HBox
layout.setContentsMargins(left, top, right, bottom)

在PyQt5上对我不起作用。方法是相同的,但无论我设置什么边距大小都没有任何效果。 - Karolis

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接