PyQt(Python+Qt)学习随笔:Designer中的QDialogButtonBox的orientation和centerButtons属性

orientation属性

orientation属性表示QDialogButtonBox的方向,缺省情况下,方向为水平方向(值为Qt.Horizontal),表示QDialogButtonBox中的按钮成水平排列,可以调整为垂直方向(值为Qt.Vertical),表示QDialogButtonBox中的按钮成垂直排列。

可以通过方法orientation()、setOrientation(Qt.Orientation orientation)读取和设置该属性。

centerButtons属性

centerButtons属性表示QDialogButtonBox的按钮是否居中排列,默认情况下,此属性为False。这种行为对于大多数类型的对话框都是合适的。一个显著的例外是大多数平台(如Windows)上的消息框,其中按钮是水平居中。

可以通过方法centerButtons()、setCenterButtons(bool center)读取和设置该属性。

老猿Python,跟老猿学Python!

博文目录

博客地址

原文地址:https://www.cnblogs.com/LaoYuanPython/p/12003022.html