Widgets that reimplement TQWidget::sizePolicy() return a QSizePolicy that describes the horizontal and vertical resizing policy they prefer when being laid out. Only one of the constructors is of interest in most applications.
QSizePolicy contains two independent SizeType objects; one describes the widgets's horizontal size policy, and the other describes its vertical size policy. It also contains a flag to indicate whether the height and width of its preferred size are related.
.PP
The horizontal and vertical SizeTypes are set in the usual constructor and can be queried using a variety of functions.
.PP
The hasHeightForWidth() flag indicates whether the widget's sizeHint() is width-dependent (such as a word-wrapping label) or not.
.PP
See also QSizePolicy::SizeType, Widget Appearance and Style, and Layout Management.
.SS "Member Type Documentation"
.SH "QSizePolicy::ExpandData"
This enum type describes in which directions a widget can make use of extra space. There are four possible values:
.TP
\fCQSizePolicy::NoDirection\fR - the widget cannot make use of extra space in any direction.
.TP
\fCQSizePolicy::Horizontally\fR - the widget can usefully be wider than the sizeHint().
.TP
\fCQSizePolicy::Vertically\fR - the widget can usefully be taller than the sizeHint().
.TP
\fCQSizePolicy::BothDirections\fR - the widget can usefully be both wider and taller than the sizeHint().
.SH "QSizePolicy::SizeType"
The per-dimension sizing types used when constructing a QSizePolicy are:
\fCQSizePolicy::Fixed\fR - The TQWidget::sizeHint() is the only acceptable alternative, so the widget can never grow or shrink (e.g. the vertical direction of a push button).
\fCQSizePolicy::Minimum\fR - The sizeHint() is minimal, and sufficient. The widget can be expanded, but there is no advantage to it being larger (e.g. the horizontal direction of a push button). It cannot be smaller than the size provided by sizeHint().
.TP
\fCQSizePolicy::Maximum\fR - The sizeHint() is a maximum. The widget can be shrunk any amount without detriment if other widgets need the space (e.g. a separator line). It cannot be larger than the size provided by sizeHint().
\fCQSizePolicy::Preferred\fR - The sizeHint() is best, but the widget can be shrunk and still be useful. The widget can be expanded, but there is no advantage to it being larger than sizeHint() (the default TQWidget policy).
\fCQSizePolicy::Expanding\fR - The sizeHint() is a sensible size, but the widget can be shrunk and still be useful. The widget can make use of extra space, so it should get as much space as possible (e.g. the horizontal direction of a slider).
.TP
\fCQSizePolicy::MinimumExpanding\fR - The sizeHint() is minimal, and sufficient. The widget can make use of extra space, so it should get as much space as possible (e.g. the horizontal direction of a slider).
.TP
\fCQSizePolicy::Ignored\fR - the sizeHint() is ignored. The widget will get as much space as possible.
It constructs a QSizePolicy with independent horizontal and vertical sizing types, \fIhor\fR and \fIver\fR respectively. These sizing types affect how the widget is treated by the layout engine.
.PP
If \fIhfw\fR is TRUE, the preferred height of the widget is dependent on the width of the widget (for example, a QLabel with line wrapping).
.PP
See also horData(), verData(), and hasHeightForWidth().
Constructs a QSizePolicy with independent horizontal and vertical sizing types \fIhor\fR and \fIver\fR, and stretch factors \fIhorStretch\fR and \fIverStretch\fR.
.PP
If \fIhfw\fR is TRUE, the preferred height of the widget is dependent on the width of the widget.
.PP
See also horStretch() and verStretch().
.SH "ExpandData QSizePolicy::expanding () const"
Returns whether this layout can make use of more space than sizeHint(). A value of Vertical or Horizontal means that it wants to grow in only one dimension, whereas BothDirections means that it wants to grow in both dimensions.
.PP
See also mayShrinkHorizontally(), mayGrowHorizontally(), mayShrinkVertically(), and mayGrowVertically().