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/tqlayoutitem.3qt

227 lines
8.0 KiB

'\" t
.TH TQLayoutItem 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
TQLayoutItem \- Abstract item that a TQLayout manipulates
.SH SYNOPSIS
\fC#include <tqlayout.h>\fR
.PP
Inherited by TQLayout, TQSpacerItem, and TQWidgetItem.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBTQLayoutItem\fR ( int alignment = 0 )"
.br
.ti -1c
.BI "virtual \fB~TQLayoutItem\fR ()"
.br
.ti -1c
.BI "virtual TQSize \fBsizeHint\fR () const = 0"
.br
.ti -1c
.BI "virtual TQSize \fBminimumSize\fR () const = 0"
.br
.ti -1c
.BI "virtual TQSize \fBmaximumSize\fR () const = 0"
.br
.ti -1c
.BI "virtual TQSizePolicy::ExpandData \fBexpanding\fR () const = 0"
.br
.ti -1c
.BI "virtual void \fBsetGeometry\fR ( const TQRect & r ) = 0"
.br
.ti -1c
.BI "virtual TQRect \fBgeometry\fR () const = 0"
.br
.ti -1c
.BI "virtual bool \fBisEmpty\fR () const = 0"
.br
.ti -1c
.BI "virtual bool \fBhasHeightForWidth\fR () const"
.br
.ti -1c
.BI "virtual int \fBheightForWidth\fR ( int w ) const"
.br
.ti -1c
.BI "virtual void \fBinvalidate\fR ()"
.br
.ti -1c
.BI "virtual TQWidget * \fBwidget\fR ()"
.br
.ti -1c
.BI "virtual TQLayoutIterator \fBiterator\fR ()"
.br
.ti -1c
.BI "virtual TQLayout * \fBlayout\fR ()"
.br
.ti -1c
.BI "virtual TQSpacerItem * \fBspacerItem\fR ()"
.br
.ti -1c
.BI "int \fBalignment\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetAlignment\fR ( int a )"
.br
.in -1c
.SH DESCRIPTION
The TQLayoutItem class provides an abstract item that a TQLayout manipulates.
.PP
This is used by custom layouts.
.PP
Pure virtual functions are provided to return information about the layout, including, sizeHint(), minimumSize(), maximumSize() and expanding().
.PP
The layout's geometry can be set and retrieved with setGeometry() and geometry(), and its alignment with setAlignment() and alignment().
.PP
isEmpty() returns whether the layout is empty. iterator() returns an iterator for the layout's children. If the concrete item is a TQWidget, it can be retrieved using widget(). Similarly for layout() and spacerItem().
.PP
See also TQLayout, Widget Appearance and Style, and Layout Management.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQLayoutItem::TQLayoutItem ( int alignment = 0 )"
Constructs a layout item with an \fIalignment\fR that is a bitwise OR of the TQt::AlignmentFlags. Not all subclasses support alignment.
.SH "TQLayoutItem::~TQLayoutItem ()\fC [virtual]\fR"
Destroys the TQLayoutItem.
.SH "int TQLayoutItem::alignment () const"
Returns the alignment of this item.
.SH "TQSizePolicy::ExpandData TQLayoutItem::expanding () const\fC [pure virtual]\fR"
Implemented in subclasses to return the direction(s) this item" wants" to expand in (if any).
.PP
Reimplemented in TQLayout, TQSpacerItem, and TQWidgetItem.
.SH "TQRect TQLayoutItem::geometry () const\fC [pure virtual]\fR"
Returns the rectangle covered by this layout item.
.PP
Example: customlayout/border.cpp.
.SH "bool TQLayoutItem::hasHeightForWidth () const\fC [virtual]\fR"
Returns TRUE if this layout's preferred height depends on its width; otherwise returns FALSE. The default implementation returns FALSE.
.PP
Reimplement this function in layout managers that support height for width.
.PP
See also heightForWidth() and TQWidget::heightForWidth().
.PP
Examples:
.)l customlayout/border.cpp and customlayout/flow.cpp.
.PP
Reimplemented in TQGridLayout and TQBoxLayout.
.SH "int TQLayoutItem::heightForWidth ( int w ) const\fC [virtual]\fR"
Returns the preferred height for this layout item, given the width \fIw\fR.
.PP
The default implementation returns -1, indicating that the preferred height is independent of the width of the item. Using the function hasHeightForWidth() will typically be much faster than calling this function and testing for -1.
.PP
Reimplement this function in layout managers that support height for width. A typical implementation will look like this:
.PP
.nf
.br
int MyLayout::heightForWidth( int w ) const
.br
{
.br
if ( cache_dirty || cached_width != w ) {
.br
// not all C++ compilers support "mutable"
.br
MyLayout *that = (MyLayout*)this;
.br
int h = calculateHeightForWidth( w );
.br
that->cached_hfw = h;
.br
return h;
.br
}
.br
return cached_hfw;
.br
}
.br
.fi
.PP
Caching is strongly recommended; without it layout will take exponential time.
.PP
See also hasHeightForWidth().
.PP
Example: customlayout/flow.cpp.
.PP
Reimplemented in TQGridLayout and TQBoxLayout.
.SH "void TQLayoutItem::invalidate ()\fC [virtual]\fR"
Invalidates any cached information in this layout item.
.PP
Reimplemented in TQLayout.
.SH "bool TQLayoutItem::isEmpty () const\fC [pure virtual]\fR"
Implemented in subclasses to return whether this item is empty, i.e. whether it contains any widgets.
.PP
Reimplemented in TQLayout, TQSpacerItem, and TQWidgetItem.
.SH "TQLayoutIterator TQLayoutItem::iterator ()\fC [virtual]\fR"
Returns an iterator over this item's TQLayoutItem children. The default implementation returns an empty iterator.
.PP
Reimplement this function in subclasses that can have children.
.PP
Reimplemented in TQLayout.
.SH "TQLayout * TQLayoutItem::layout ()\fC [virtual]\fR"
If this item is a TQLayout, it is returned as a TQLayout; otherwise 0 is returned. This function provides type-safe casting.
.SH "TQSize TQLayoutItem::maximumSize () const\fC [pure virtual]\fR"
Implemented in subclasses to return the maximum size of this item.
.PP
Reimplemented in TQLayout, TQSpacerItem, and TQWidgetItem.
.SH "TQSize TQLayoutItem::minimumSize () const\fC [pure virtual]\fR"
Implemented in subclasses to return the minimum size of this item.
.PP
Examples:
.)l customlayout/border.cpp, customlayout/card.cpp, and customlayout/flow.cpp.
.PP
Reimplemented in TQLayout, TQSpacerItem, and TQWidgetItem.
.SH "void TQLayoutItem::setAlignment ( int a )\fC [virtual]\fR"
Sets the alignment of this item to \fIa\fR, which is a bitwise OR of the TQt::AlignmentFlags. Not all subclasses support alignment.
.PP
Example: chart/optionsform.cpp.
.SH "void TQLayoutItem::setGeometry ( const TQRect & r )\fC [pure virtual]\fR"
Implemented in subclasses to set this item's geometry to \fIr\fR.
.PP
Examples:
.)l customlayout/border.cpp, customlayout/card.cpp, and customlayout/flow.cpp.
.PP
Reimplemented in TQLayout, TQSpacerItem, and TQWidgetItem.
.SH "TQSize TQLayoutItem::sizeHint () const\fC [pure virtual]\fR"
Implemented in subclasses to return the preferred size of this item.
.PP
Examples:
.)l customlayout/border.cpp, customlayout/card.cpp, and customlayout/flow.cpp.
.PP
Reimplemented in TQSpacerItem, TQWidgetItem, TQGridLayout, and TQBoxLayout.
.SH "TQSpacerItem * TQLayoutItem::spacerItem ()\fC [virtual]\fR"
If this item is a TQSpacerItem, it is returned as a TQSpacerItem; otherwise 0 is returned. This function provides type-safe casting.
.SH "TQWidget * TQLayoutItem::widget ()\fC [virtual]\fR"
If this item is a TQWidget, it is returned as a TQWidget; otherwise 0 is returned. This function provides type-safe casting.
.PP
Reimplemented in TQWidgetItem.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/tqlayoutitem.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 (tqlayoutitem.3qt) and the Qt
version (3.3.8).