Compatibility Members for QLayout

以下成員源於類 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:: QLayout ( QWidget * parent , int margin , int spacing = -1, const char * name = 0)

構造新的頂層 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:: QLayout ( QLayout * parentLayout , int spacing = -1, const char * name = 0)

構造新的子級 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:: QLayout ( int spacing , const char * name = 0)

構造新的子級 QLayout called name 。若 spacing is -1, this QLayout inherits its parent's spacing (); otherwise the value of spacing 被使用。

必須將此布局插入另一布局,在幾何體管理將工作前。

void QLayout:: add ( QWidget * widget )

使用 addWidget ( widget ) 代替。

bool QLayout:: autoAdd () const

Automatically adding widgets is deprecated. Use addWidget () or addLayout() instead.

另請參閱 setAutoAdd ().

int QLayout:: defaultBorder () const

使用 spacing () 代替。

[protected] void QLayout:: deleteAllItems ()

Removes and deletes all items in this layout.

void QLayout:: freeze ( int w = 0, int h = 0)

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.

bool QLayout:: isTopLevel () const

Returns true if this layout is a top-level layout, i.e. not a child of another layout; otherwise returns false.

QLayoutIterator QLayout:: iterator ()

Use a QLayoutIterator() constructor instead.

QWidget * QLayout:: mainWidget () const

使用 parentWidget () 代替。

void QLayout:: remove ( QWidget * widget )

使用 removeWidget ( widget ) 代替。

SizeConstraint QLayout:: resizeMode () const

使用 sizeConstraint () 代替。

另請參閱 setResizeMode ().

void QLayout:: setAutoAdd ( bool a )

Automatically adding widgets is deprecated. Use addWidget () or addLayout() instead.

另請參閱 autoAdd ().

void QLayout:: setResizeMode ( SizeConstraint constraint )

使用 setSizeConstraint ( constraint ) 代替。

另請參閱 resizeMode ().