45 #include <QtCore/qobject.h> 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
114 :
data(horizontal | (vertical << HSize)) { }
116 :
data(horizontal | (vertical << HSize)) { setControlType(type); }
127 Qt::Orientations result;
128 if (verticalPolicy() & ExpandFlag)
130 if (horizontalPolicy() & ExpandFlag)
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(); }
178 :
data(hor | (ver<<HSize) | (hfw ? (1U<<2*HSize) : 0)) { }
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 223 #ifndef QT_NO_DATASTREAM 230 Policy hData = horizontalPolicy();
231 Policy vData = verticalPolicy();
234 setHorizontalPolicy(vData);
235 setVerticalPolicy(hData);
236 setHorizontalStretch(vStretch);
237 setVerticalStretch(hStretch);
244 #endif // QSIZEPOLICY_H The QVariant class acts like a union for the most common Qt data types.
void setHorizontalStretch(uchar stretchFactor)
#define QT_END_NAMESPACE
This macro expands to.
bool operator==(const QSizePolicy &s) const
QSizePolicy(Policy horizontal, Policy vertical)
#define Q_DECLARE_FLAGS(Flags, Enum)
The Q_DECLARE_FLAGS() macro expands to.
bool hasWidthForHeight() const
Policy horizontalPolicy() const
QSizePolicy(Policy horizontal, Policy vertical, ControlType type)
bool operator!=(const QSizePolicy &s) const
int horizontalStretch() const
void setHeightForWidth(bool b)
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool hasHeightForWidth() const
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
The Q_DECLARE_OPERATORS_FOR_FLAGS() macro declares global operator|() functions for Flags...
Qt::Orientations expandingDirections() const
static const char * data(const QByteArray &arr)
int verticalStretch() const
void setHorizontalPolicy(Policy d)
Q_GUI_EXPORT QDataStream & operator>>(QDataStream &, QSizePolicy &)
Policy verticalPolicy() const
void setVerticalPolicy(Policy d)
The QDataStream class provides serialization of binary data to a QIODevice.
Q_GUI_EXPORT QDataStream & operator<<(QDataStream &, const QSizePolicy &)
void setWidthForHeight(bool b)
void setVerticalStretch(uchar stretchFactor)