Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy. More...
#include <qsizepolicy.h>
The size policy of a widget is an expression of its willingness to be resized in various ways.
Widgets that reimplement QWidget::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.
The per-dimension SizeType objects are set in the usual constructor and can be queried using a variety of functions, none of which are really interesting to application programmers.
The hasHeightForWidth() flag indicates whether the widget's sizeHint() is width-dependent (such as a word-wrapping label).
See also QSizePolicy::SizeType, Widget Appearance and Style and Layout Management.
This enum type describes in which directions a widget can make use of extra space. There are four possible values:
The per-dimension sizing types used when constructing a QSizePolicy are:
In any case, QLayout never shrinks a widget below the QWidget::minimumSizeHint().
Default constructor; produces a minimally initialized QSizePolicy.
This is the constructor normally used to return a value in the overridden QWidget::sizePolicy() function of a QWidget subclass.
It constructs a QSizePolicy with independent horizontal and vertical sizing types, hor and ver respectively. These sizing types affect how the widget is treated by the layout engine.
If hfw is TRUE, the preferred height of the widget is dependent on the width of the widget (for example, a QLabel with line wrapping).
See also horData(), verData() and hasHeightForWidth().
Constructs a QSizePolicy with independent horizontal and vertical sizing types hor and ver, and stretch factors horStretch and verStretch.
If hfw is TRUE, the preferred height of the widget is dependent on the width of the widget.
See also horStretch() and verStretch().
Returns a value indicating whether the widget can make use of extra space (i.e. if it "wants" to grow) horizontally and/or vertically.
See also mayShrinkHorizontally(), mayGrowHorizontally(), mayShrinkVertically() and mayGrowVertically().
Returns TRUE if the widget's preferred height depends on its width; otherwise returns FALSE.
See also setHeightForWidth().
Returns the horizontal component of the size policy.
See also setHorData(), verData() and horStretch().
Returns the horizontal stretch factor of the size policy.
See also setHorStretch() and verStretch().
Returns TRUE if the widget can sensibly be wider than its sizeHint(); otherwise returns FALSE.
See also mayGrowVertically() and mayShrinkHorizontally().
Returns TRUE if the widget can sensibly be taller than its sizeHint(); otherwise returns FALSE.
See also mayGrowHorizontally() and mayShrinkVertically().
Returns TRUE if the widget can sensibly be narrower than its sizeHint(); otherwise returns FALSE.
See also mayShrinkVertically() and mayGrowHorizontally().
Returns TRUE if the widget can sensibly be shorter than its sizeHint(); otherwise returns FALSE.
See also mayShrinkHorizontally() and mayGrowVertically().
Returns TRUE if this policy is different from s; otherwise returns FALSE.
See also operator==().
Returns TRUE if this policy is equal to s; otherwise returns FALSE.
See also operator!=().
Sets the hasHeightForWidth() flag to b.
See also hasHeightForWidth().
Sets the horizontal component of the size policy to size type d.
See also horData() and setVerData().
Sets the horizontal stretch factor of the size policy to sf.
See also horStretch() and setVerStretch().
Sets the vertical component of the size policy to size type d.
See also verData() and setHorData().
Sets the vertical stretch factor of the size policy to sf.
See also verStretch() and setHorStretch().
Returns the vertical component of the size policy.
See also setVerData(), horData() and verStretch().
Returns the vertical stretch factor of the size policy.
See also setVerStretch() and horStretch().
This file is part of the Qt toolkit. Copyright © 1995-2002 Trolltech. All Rights Reserved.
Copyright © 2002 Trolltech | Trademarks | Qt version 3.0.5
|