本系列文章长期更新修改.
QBoxLayout是常用的线性布局,如果说QGridLayout是二维上的布局,QBoxLayout就是一维上的布局.
QHBoxLayout和QVBoxLayout继承自QBoxLayout,分别是水平和垂直的盒子布局.
属性:
QBoxLayout
Types
- enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop, Down, Up }
Methods
- __init__ (self, Direction direction, QWidget parent = None)
- addItem (self, QLayoutItem)
- addLayout (self, QLayout layout, int stretch = 0)
- addSpacerItem (self, QSpacerItem spacerItem)
- addSpacing (self, int size)
- addStretch (self, int stretch = 0)
- addStrut (self, int)
- addWidget (self, QWidget, int stretch = 0, Qt.Alignment alignment = 0)
- int count (self)
- Direction direction (self)
- Qt.Orientations expandingDirections (self)
- bool hasHeightForWidth (self)
- int heightForWidth (se