以下成員源於類 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 () 被使用。
使用
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 ().