在PyQt的设置布局边距

问题描述 投票:3回答:1

在Qt Designer中,我可以使用属性布局*保证金设置的VBox或HBox中的保证金。

我怎样才能做到这一点在PyQt的?

qt layout pyqt qt-designer
1个回答
12
投票

您可以使用QLayout.setContentsMargins

# layout is a defined VBox or HBox
layout.setContentsMargins(left, top, right, bottom)
© www.soinside.com 2019 - 2024. All rights reserved.