Qt Reference Documentation

Qt 3 Support Members for QSizePolicy

The following class members are part of the Qt 3 support layer. They are provided to help you port old code to Qt 4. We advise against using them in new code.

Public Types

enum ExpandData { NoDirection, Horizontally, Vertically, BothDirections }
typedef SizeType

Public Functions

QSizePolicy ( Policy horizontal, Policy vertical, bool dependent )
QSizePolicy ( Policy horizontal, Policy vertical, uchar horizontalStretch, uchar verticalStretch, bool dependent = false )
Qt::Orientations expanding () const
Policy horData () const
uint horStretch () const
bool mayGrowHorizontally () const
bool mayGrowVertically () const
bool mayShrinkHorizontally () const
bool mayShrinkVertically () const
void setHorData ( Policy policy )
void setHorStretch ( uchar stretch )
void setVerData ( Policy policy )
void setVerStretch ( uchar stretch )
Policy verData () const
uint verStretch () const

Member Type Documentation

enum QSizePolicy::ExpandData

Use the Qt::Orientations enum instead.

ConstantValueDescription
QSizePolicy::NoDirection0x0Use 0 instead.
QSizePolicy::Horizontally0x1Use Qt::Horizontal instead.
QSizePolicy::Vertically0x2Use Qt::Vertical instead.
QSizePolicy::BothDirections0x3Use Qt::Horizontal | Qt::Vertical instead.

typedef QSizePolicy::SizeType

Use the QSizePolicy::Policy enum instead.

Member Function Documentation

QSizePolicy::QSizePolicy ( Policy horizontal, Policy vertical, bool dependent )

Use the QSizePolicy() constructor and the setHeightForWidth() function instead.

For example, if you have code like

 QSizePolicy *policy = new QSizePolicy(horizontal, vertical, dependent);

you can rewrite it as

 QSizePolicy *policy = new QSizePolicy(horizontal, vertical);
 policy->setHeightForWidth(dependent);

QSizePolicy::QSizePolicy ( Policy horizontal, Policy vertical, uchar horizontalStretch, uchar verticalStretch, bool dependent = false )

Use the QSizePolicy() constructor and call the setHorizontalStretch(), setVerticalStretch(), and setHeightForWidth() functions instead.

For example, if you have code like

 QSizePolicy *policy = new QSizePolicy(horizontal, vertical,
                                                          horizontalStretch, verticalStretch,
                                                          dependent);

you can rewrite it as

 QSizePolicy *policy = new QSizePolicy(horizontal, vertical);
 policy->setHorizontalStretch(horizontalStretch);
 policy->setVerticalStretch(verticalStretch);
 policy->setHeightForWidth(dependent);

Qt::Orientations QSizePolicy::expanding () const

Use expandingDirections() instead.

Policy QSizePolicy::horData () const

Use horizontalPolicy() instead.

See also setHorData().

uint QSizePolicy::horStretch () const

Use horizontalStretch() instead.

See also setHorStretch().

bool QSizePolicy::mayGrowHorizontally () const

Use the horizontalPolicy() function combined with the QSizePolicy::PolicyFlag enum instead.

For example, if you have code like

 bool policy = mayGrowHorizontally();

you can rewrite it as

 bool policy = horizontalPolicy() & QSizePolicy::GrowFlag;

bool QSizePolicy::mayGrowVertically () const

Use the verticalPolicy() function combined with the QSizePolicy::PolicyFlag enum instead.

For example, if you have code like

 bool policy = mayGrowVertically();

you can rewrite it as

 bool policy = verticalPolicy() & QSizePolicy::GrowFlag;

bool QSizePolicy::mayShrinkHorizontally () const

Use the horizontalPolicy() function combined with the QSizePolicy::PolicyFlag enum instead.

For example, if you have code like

 bool policy = mayShrinkHorizontally();

you can rewrite it as

 bool policy = horizontalPolicy() & QSizePolicy::ShrinkFlag;

bool QSizePolicy::mayShrinkVertically () const

Use the verticalPolicy() function combined with the QSizePolicy::PolicyFlag enum instead.

For example, if you have code like

 bool policy = mayShrinkVertically();

you can rewrite it as

 bool policy = verticalPolicy() & QSizePolicy::ShrinkFlag;

void QSizePolicy::setHorData ( Policy policy )

Use setHorizontalPolicy() instead.

See also horData().

void QSizePolicy::setHorStretch ( uchar stretch )

Use setHorizontalStretch() instead.

See also horStretch().

void QSizePolicy::setVerData ( Policy policy )

Use setVerticalPolicy() instead.

See also verData().

void QSizePolicy::setVerStretch ( uchar stretch )

Use setVerticalStretch() instead.

See also verStretch().

Policy QSizePolicy::verData () const

Use verticalPolicy() instead.

See also setVerData().

uint QSizePolicy::verStretch () const

Use verticalStretch() instead.

See also setVerStretch().

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.