Qt logo

QSizePolicy Class Reference


A layout attribute describing horizontal and vertical resizing. More...

#include <qsizepolicy.h>

List of all member functions.

Public Members


Detailed Description

A layout attribute describing horizontal and vertical resizing.

Widgets which override QWidget::sizePolicy() return a QSizePolicy describing the horizontal and vertical resizing policy best used when laying out the widget.

Only the constructor is of interest in most applications.


Member Type Documentation

QSizePolicy::SizeType

The sizing types used when constructing a QSizePolicy are:

Member Function Documentation

QSizePolicy::QSizePolicy()

Default constructor, produces a minimally initialized QSizePolicy.

QSizePolicy::QSizePolicy(SizeTypehor, SizeTypever, boolhfw=FALSE)

This is the constructor normally used to return a value in the overridden sizeHint() 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 link QLayout layout engine\endlink.

If hfw is TRUE, the preferred height of the widget is dependent on the width of the widget (for example, a QLabel with automatic word-breaking).

boolQSizePolicy::hasHeightForWidth()const

Returns TRUE if the widget's preferred height depends on its width.

QSizePolicy::SizeTypeQSizePolicy::horData()const

Returns the horizontal component of the size policy.

boolQSizePolicy::mayGrowHorizontally()const

Returns TRUE if the widget can sensibly be wider than its sizeHint().

boolQSizePolicy::mayGrowVertically()const

Returns TRUE if the widget can sensibly be taller than its sizeHint().

boolQSizePolicy::mayShrinkHorizontally()const

Returns TRUE if the widget can sensibly be narrower than its sizeHint().

boolQSizePolicy::mayShrinkVertically()const

Returns TRUE if the widget can sensibly be lower than its sizeHint().

voidQSizePolicy::setHeightForWidth(boolb)

Sets the hasHeightForWidth() flag to b.

voidQSizePolicy::setHorData(SizeTyped)

Sets the horizontal component of the size policy to d.

voidQSizePolicy::setVerData(SizeTyped)

Sets the vertical component of the size policy to d.

QSizePolicy::SizeTypeQSizePolicy::verData()const

Returns the vertical component of the size policy.


Search the documentation, FAQ, qt-interest archive and more (uses www.troll.no):


This file is part of the Qt toolkit, copyright © 1995-99 Troll Tech, all rights reserved.


Copyright 1999 Troll TechTrademarks
Qt version 2.0.2