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!

博文目录

博客地址

posted on 2019-11-25 22:58  老猿Python  阅读(517)  评论(0)    收藏  举报

< 2025年9月 >
31 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 1 2 3 4
5 6 7 8 9 10 11

统计

点击右上角即可分享
微信分享提示