以下成员源于类 QLayout are part of the Qt compatibility layer. We advise against using them in new code.
| QLayout (QWidget * parent , int margin , int spacing = -1, const char * name = 0) | |
| QLayout (QLayout * parentLayout , int spacing = -1, const char * name = 0) | |
| QLayout (int spacing , const char * name = 0) | |
| void | add (QWidget * widget ) |
| bool | autoAdd () const |
| int | defaultBorder () const |
| void | freeze (int w = 0, int h = 0) |
| bool | isTopLevel () const |
| QLayoutIterator | iterator () |
| QWidget * | mainWidget () const |
| void | remove (QWidget * widget ) |
| SizeConstraint | resizeMode () const |
| void | setAutoAdd (bool a ) |
| void | setResizeMode (SizeConstraint constraint ) |
| void | deleteAllItems () |
构造新的顶层 QLayout called name , with parent widget parent . parent 不可以为 0。
The margin is the number of pixels between the edge of the widget and the managed children. The spacing sets the value of spacing (), which gives the spacing between the managed widgets. If spacing is -1 (the default), spacing is set to the value of margin .
Widget 只可以有一个顶层布局。返回它通过 QWidget::layout ()
另请参阅 QWidget::setLayout ().
构造新的子级 QLayout called name , and places it inside parentLayout by using the default placement defined by addItem ().
若 spacing is -1, this QLayout 继承 parentLayout 's spacing (), otherwise the value of spacing 被使用。
构造新的子级 QLayout called name 。若 spacing is -1, this QLayout inherits its parent's spacing (); otherwise the value of spacing 被使用。
必须将此布局插入另一布局,在几何体管理将工作之前。
使用 addWidget ( widget ) 代替。
Automatically adding widgets is deprecated. Use addWidget () or addLayout() instead.
另请参阅 setAutoAdd ().
使用 spacing () 代替。
[protected]
void
QLayout::
deleteAllItems
()
Removes and deletes all items in this layout.
Sets this layout's parent widget to a fixed size with width w 和高度 h , stopping the user from resizing it, and also prevents the layout from resizing it, even if the layout's size hint should change. Does nothing if this is not a top-level layout (i.e., if parent ()-> isWidgetType ()).
As a special case, if both w and h are 0, then the layout's current sizeHint () is used.
使用
setResizeMode(Fixed)
to stop the widget from being resized by the user, while still allowing the layout to resize it when the
sizeHint
() changes.
使用
setResizeMode(FreeResize)
to allow the user to resize the widget, while preventing the layout from resizing it.
Returns true if this layout is a top-level layout, i.e. not a child of another layout; otherwise returns false.
Use a QLayoutIterator() constructor instead.
使用 parentWidget () 代替。
使用 removeWidget ( widget ) 代替。
使用 sizeConstraint () 代替。
另请参阅 setResizeMode ().
Automatically adding widgets is deprecated. Use addWidget () or addLayout() instead.
另请参阅 autoAdd ().
使用 setSizeConstraint ( constraint ) 代替。
另请参阅 resizeMode ().