WidgetFactory Class

( qdesigner_internal::WidgetFactory )
继承: QObject

重实现公共函数

virtual QWidget * containerOfWidget (QWidget * w ) const override
virtual QLayout * createLayout (QWidget * widget , QLayout * parentLayout , int type ) const override
virtual QWidget * widgetOfContainer (QWidget * w ) const override

成员函数文档编制

[override virtual] QWidget *WidgetFactory:: containerOfWidget ( QWidget * w ) const

Returns the widget into which children should be inserted when w is a container known to designer.

Usually, it is w itself, but there are exceptions (for example, a tabwidget is known to designer as a container, but the child widgets should be inserted into the current page of the tabwidget. In this case, the current page of the tabwidget would be returned.)

[override virtual] QLayout *WidgetFactory:: createLayout ( QWidget * widget , QLayout * parentLayout , int type ) const

Creates a layout on the widget widget of the type type which can be HBox , VBox or Grid .

[override virtual] QWidget *WidgetFactory:: widgetOfContainer ( QWidget * w ) const

Returns the actual designer widget of the container w . This is normally w itself, but it might be a parent or grand parent of w (for example, when working with a tabwidget and w is the container which contains and layouts children, but the actual widget known to designer is the tabwidget which is the parent of w . In this case, the tabwidget would be returned.)