61 enum SizePolicyMasks {
64 VMask = HMask << HSize,
67 CTMask = ((0x1 << CTSize) - 1) << CTShift,
68 WFHShift = CTShift + CTSize,
69 UnusedShift = WFHShift + 1,
85 Preferred = GrowFlag | ShrinkFlag,
86 MinimumExpanding = GrowFlag | ExpandFlag,
87 Expanding = GrowFlag | ShrinkFlag | ExpandFlag,
88 Ignored = ShrinkFlag | GrowFlag | IgnoreFlag
92 DefaultType = 0x00000001,
93 ButtonBox = 0x00000002,
94 CheckBox = 0x00000004,
95 ComboBox = 0x00000008,
97 GroupBox = 0x00000020,
100 LineEdit = 0x00000100,
101 PushButton = 0x00000200,
102 RadioButton = 0x00000400,
104 SpinBox = 0x00001000,
105 TabWidget = 0x00002000,
106 ToolButton = 0x00004000
108 Q_DECLARE_FLAGS(ControlTypes, ControlType)
114 :
data(horizontal | (vertical << HSize)) { }
116 :
data(horizontal | (vertical << HSize)) { setControlType(type); }
120 ControlType controlType()
const;
124 void setControlType(ControlType
type);
127 Qt::Orientations result;
128 if (verticalPolicy() & ExpandFlag)
130 if (horizontalPolicy() & ExpandFlag)
142 operator QVariant()
const;
152 typedef Policy SizeType;
154 typedef Qt::Orientations ExpandData;
159 BothDirections = Horizontally | Vertically
170 inline QT3_SUPPORT
bool mayShrinkHorizontally()
const
171 {
return horizontalPolicy() & ShrinkFlag; }
172 inline QT3_SUPPORT
bool mayShrinkVertically()
const {
return verticalPolicy() & ShrinkFlag; }
173 inline QT3_SUPPORT
bool mayGrowHorizontally()
const {
return horizontalPolicy() & GrowFlag; }
174 inline QT3_SUPPORT
bool mayGrowVertically()
const {
return verticalPolicy() & GrowFlag; }
175 inline QT3_SUPPORT Qt::Orientations expanding()
const {
return expandingDirections(); }
177 QT3_SUPPORT_CONSTRUCTOR QSizePolicy(Policy hor, Policy ver,
bool hfw)
178 :
data(hor | (ver<<HSize) | (hfw ? (1U<<2*HSize) : 0)) { }
180 QT3_SUPPORT_CONSTRUCTOR QSizePolicy(Policy hor, Policy ver, uchar hors, uchar vers,
bool hfw =
false)
181 :
data(hor | (ver<<HSize) | (hfw ? (1U<<2*HSize) : 0)) {
182 setHorizontalStretch(hors);
183 setVerticalStretch(vers);
186 inline QT3_SUPPORT Policy horData()
const {
return static_cast<Policy
>(
data & HMask); }
187 inline QT3_SUPPORT Policy verData()
const {
return static_cast<Policy
>((
data & VMask) >> HSize); }
188 inline QT3_SUPPORT
void setHorData(Policy d) { setHorizontalPolicy(d); }
189 inline QT3_SUPPORT
void setVerData(Policy d) { setVerticalPolicy(d); }
191 inline QT3_SUPPORT uint horStretch()
const {
return horizontalStretch(); }
192 inline QT3_SUPPORT uint verStretch()
const {
return verticalStretch(); }
193 inline QT3_SUPPORT
void setHorStretch(uchar sf) { setHorizontalStretch(sf); }
194 inline QT3_SUPPORT
void setVerStretch(uchar sf) { setVerticalStretch(sf); }
198 #ifndef QT_NO_DATASTREAM
202 QSizePolicy(
int i) :
data(i) { }
221 Q_DECLARE_OPERATORS_FOR_FLAGS(QSizePolicy::ControlTypes)
223 #ifndef QT_NO_DATASTREAM
244 #endif // QSIZEPOLICY_H
GLuint GLuint GLsizei GLenum type
bool operator!=(const QSizePolicy &s) const
bool hasHeightForWidth() const
QSizePolicy(Policy horizontal, Policy vertical, ControlType type)
bool operator==(const QSizePolicy &s) const
void setVerticalStretch(uchar stretchFactor)
bool hasWidthForHeight() const
void setHorizontalStretch(uchar stretchFactor)
#define QT_BEGIN_NAMESPACE
Policy verticalPolicy() const
GLsizei GLsizei GLenum GLenum const GLvoid * data
void setVerticalPolicy(Policy d)
QSizePolicy(Policy horizontal, Policy vertical)
Q_GUI_EXPORT QDataStream & operator>>(QDataStream &, QSizePolicy &)
Policy horizontalPolicy() const
void setHorizontalPolicy(Policy d)
void setHeightForWidth(bool b)
Qt::Orientations expandingDirections() const
void setWidthForHeight(bool b)
Q_GUI_EXPORT QDataStream & operator<<(QDataStream &, const QSizePolicy &)
int horizontalStretch() const
GLsizei GLboolean transpose
int verticalStretch() const