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 () 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.

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 ().