You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/man/man3/tqsizepolicy.3qt

239 lines
10 KiB

'\" t
.TH TQSizePolicy 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
TQSizePolicy \- Layout attribute describing horizontal and vertical resizing policy
.SH SYNOPSIS
\fC#include <tqsizepolicy.h>\fR
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "enum \fBSizeType\fR { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow | MayShrink, MinimumExpanding = MayGrow | ExpMask, Expanding = MayGrow | MayShrink | ExpMask, Ignored = ExpMask }"
.br
.ti -1c
.BI "enum \fBExpandData\fR { NoDirection = 0, Horizontally = 1, Vertically = 2, Horizontal = Horizontally, Vertical = Vertically, BothDirections = Horizontally | Vertically }"
.br
.ti -1c
.BI "\fBTQSizePolicy\fR ()"
.br
.ti -1c
.BI "\fBTQSizePolicy\fR ( SizeType hor, SizeType ver, bool hfw = FALSE )"
.br
.ti -1c
.BI "\fBTQSizePolicy\fR ( SizeType hor, SizeType ver, uchar horStretch, uchar verStretch, bool hfw = FALSE )"
.br
.ti -1c
.BI "SizeType \fBhorData\fR () const"
.br
.ti -1c
.BI "SizeType \fBverData\fR () const"
.br
.ti -1c
.BI "bool \fBmayShrinkHorizontally\fR () const"
.br
.ti -1c
.BI "bool \fBmayShrinkVertically\fR () const"
.br
.ti -1c
.BI "bool \fBmayGrowHorizontally\fR () const"
.br
.ti -1c
.BI "bool \fBmayGrowVertically\fR () const"
.br
.ti -1c
.BI "ExpandData \fBexpanding\fR () const"
.br
.ti -1c
.BI "void \fBsetHorData\fR ( SizeType d )"
.br
.ti -1c
.BI "void \fBsetVerData\fR ( SizeType d )"
.br
.ti -1c
.BI "void \fBsetHeightForWidth\fR ( bool b )"
.br
.ti -1c
.BI "bool \fBhasHeightForWidth\fR () const"
.br
.ti -1c
.BI "bool \fBoperator==\fR ( const TQSizePolicy & s ) const"
.br
.ti -1c
.BI "bool \fBoperator!=\fR ( const TQSizePolicy & s ) const"
.br
.ti -1c
.BI "uint \fBhorStretch\fR () const"
.br
.ti -1c
.BI "uint \fBverStretch\fR () const"
.br
.ti -1c
.BI "void \fBsetHorStretch\fR ( uchar sf )"
.br
.ti -1c
.BI "void \fBsetVerStretch\fR ( uchar sf )"
.br
.ti -1c
.BI "void \fBtranspose\fR ()"
.br
.in -1c
.SH DESCRIPTION
The TQSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
.PP
The size policy of a widget is an expression of its willingness to be resized in various ways.
.PP
Widgets that reimplement TQWidget::sizePolicy() return a TQSizePolicy 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.
.PP
TQSizePolicy 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.
.PP
The horizontal and vertical SizeTypes are set in the usual constructor and can be queried using a variety of functions.
.PP
The hasHeightForWidth() flag indicates whether the widget's sizeHint() is width-dependent (such as a word-wrapping label) or not.
.PP
See also TQSizePolicy::SizeType, Widget Appearance and Style, and Layout Management.
.SS "Member Type Documentation"
.SH "TQSizePolicy::ExpandData"
This enum type describes in which directions a widget can make use of extra space. There are four possible values:
.TP
\fCTQSizePolicy::NoDirection\fR - the widget cannot make use of extra space in any direction.
.TP
\fCTQSizePolicy::Horizontally\fR - the widget can usefully be wider than the sizeHint().
.TP
\fCTQSizePolicy::Vertically\fR - the widget can usefully be taller than the sizeHint().
.TP
\fCTQSizePolicy::BothDirections\fR - the widget can usefully be both wider and taller than the sizeHint().
.SH "TQSizePolicy::SizeType"
The per-dimension sizing types used when constructing a TQSizePolicy are:
.TP
\fCTQSizePolicy::Fixed\fR - The TQWidget::sizeHint() is the only acceptable alternative, so the widget can never grow or shrink (e.g. the vertical direction of a push button).
.TP
\fCTQSizePolicy::Minimum\fR - The sizeHint() is minimal, and sufficient. The widget can be expanded, but there is no advantage to it being larger (e.g. the horizontal direction of a push button). It cannot be smaller than the size provided by sizeHint().
.TP
\fCTQSizePolicy::Maximum\fR - The sizeHint() is a maximum. The widget can be shrunk any amount without detriment if other widgets need the space (e.g. a separator line). It cannot be larger than the size provided by sizeHint().
.TP
\fCTQSizePolicy::Preferred\fR - The sizeHint() is best, but the widget can be shrunk and still be useful. The widget can be expanded, but there is no advantage to it being larger than sizeHint() (the default TQWidget policy).
.TP
\fCTQSizePolicy::Expanding\fR - The sizeHint() is a sensible size, but the widget can be shrunk and still be useful. The widget can make use of extra space, so it should get as much space as possible (e.g. the horizontal direction of a slider).
.TP
\fCTQSizePolicy::MinimumExpanding\fR - The sizeHint() is minimal, and sufficient. The widget can make use of extra space, so it should get as much space as possible (e.g. the horizontal direction of a slider).
.TP
\fCTQSizePolicy::Ignored\fR - the sizeHint() is ignored. The widget will get as much space as possible.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQSizePolicy::TQSizePolicy ()"
Constructs a minimally initialized TQSizePolicy.
.SH "TQSizePolicy::TQSizePolicy ( SizeType hor, SizeType ver, bool hfw = FALSE )"
This is the constructor normally used to return a value in the overridden TQWidget::sizePolicy() function of a TQWidget subclass.
.PP
It constructs a TQSizePolicy with independent horizontal and vertical sizing types, \fIhor\fR and \fIver\fR respectively. These sizing types affect how the widget is treated by the layout engine.
.PP
If \fIhfw\fR is TRUE, the preferred height of the widget is dependent on the width of the widget (for example, a QLabel with line wrapping).
.PP
See also horData(), verData(), and hasHeightForWidth().
.SH "TQSizePolicy::TQSizePolicy ( SizeType hor, SizeType ver, uchar horStretch, uchar verStretch, bool hfw = FALSE )"
Constructs a TQSizePolicy with independent horizontal and vertical sizing types \fIhor\fR and \fIver\fR, and stretch factors \fIhorStretch\fR and \fIverStretch\fR.
.PP
If \fIhfw\fR is TRUE, the preferred height of the widget is dependent on the width of the widget.
.PP
See also horStretch() and verStretch().
.SH "ExpandData TQSizePolicy::expanding () const"
Returns whether this layout can make use of more space than sizeHint(). A value of Vertical or Horizontal means that it wants to grow in only one dimension, whereas BothDirections means that it wants to grow in both dimensions.
.PP
See also mayShrinkHorizontally(), mayGrowHorizontally(), mayShrinkVertically(), and mayGrowVertically().
.SH "bool TQSizePolicy::hasHeightForWidth () const"
Returns TRUE if the widget's preferred height depends on its width; otherwise returns FALSE.
.PP
See also setHeightForWidth().
.SH "SizeType TQSizePolicy::horData () const"
Returns the horizontal component of the size policy.
.PP
See also setHorData(), verData(), and horStretch().
.SH "uint TQSizePolicy::horStretch () const"
Returns the horizontal stretch factor of the size policy.
.PP
See also setHorStretch() and verStretch().
.SH "bool TQSizePolicy::mayGrowHorizontally () const"
Returns TRUE if the widget can sensibly be wider than its sizeHint(); otherwise returns FALSE.
.PP
See also mayGrowVertically() and mayShrinkHorizontally().
.SH "bool TQSizePolicy::mayGrowVertically () const"
Returns TRUE if the widget can sensibly be taller than its sizeHint(); otherwise returns FALSE.
.PP
See also mayGrowHorizontally() and mayShrinkVertically().
.SH "bool TQSizePolicy::mayShrinkHorizontally () const"
Returns TRUE if the widget can sensibly be narrower than its sizeHint(); otherwise returns FALSE.
.PP
See also mayShrinkVertically() and mayGrowHorizontally().
.SH "bool TQSizePolicy::mayShrinkVertically () const"
Returns TRUE if the widget can sensibly be shorter than its sizeHint(); otherwise returns FALSE.
.PP
See also mayShrinkHorizontally() and mayGrowVertically().
.SH "bool TQSizePolicy::operator!= ( const TQSizePolicy & s ) const"
Returns TRUE if this policy is different from \fIs\fR; otherwise returns FALSE.
.PP
See also operator==().
.SH "bool TQSizePolicy::operator== ( const TQSizePolicy & s ) const"
Returns TRUE if this policy is equal to \fIs\fR; otherwise returns FALSE.
.PP
See also operator!=().
.SH "void TQSizePolicy::setHeightForWidth ( bool b )"
Sets the hasHeightForWidth() flag to \fIb\fR.
.PP
See also hasHeightForWidth().
.SH "void TQSizePolicy::setHorData ( SizeType d )"
Sets the horizontal component of the size policy to size type \fId\fR.
.PP
See also horData() and setVerData().
.SH "void TQSizePolicy::setHorStretch ( uchar sf )"
Sets the horizontal stretch factor of the size policy to \fIsf\fR.
.PP
See also horStretch() and setVerStretch().
.SH "void TQSizePolicy::setVerData ( SizeType d )"
Sets the vertical component of the size policy to size type \fId\fR.
.PP
See also verData() and setHorData().
.SH "void TQSizePolicy::setVerStretch ( uchar sf )"
Sets the vertical stretch factor of the size policy to \fIsf\fR.
.PP
See also verStretch() and setHorStretch().
.SH "void TQSizePolicy::transpose ()"
Swaps the horizontal and vertical policies and stretches.
.SH "SizeType TQSizePolicy::verData () const"
Returns the vertical component of the size policy.
.PP
See also setVerData(), horData(), and verStretch().
.SH "uint TQSizePolicy::verStretch () const"
Returns the vertical stretch factor of the size policy.
.PP
See also setVerStretch() and horStretch().
.SH "SEE ALSO"
.BR http://doc.trolltech.com/tqsizepolicy.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqsizepolicy.3qt) and the Qt
version (3.3.8).