⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qlayoutitem.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
字号:
'\" t.TH QLayoutItem 3qt "9 December 2002" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQLayoutItem \- Abstract item that a QLayout manipulates.SH SYNOPSIS\fC#include <qlayout.h>\fR.PPInherited by QLayout, QSpacerItem, and QWidgetItem..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQLayoutItem\fR ( int alignment = 0 )".br.ti -1c.BI "virtual \fB~QLayoutItem\fR ()".br.ti -1c.BI "virtual QSize \fBsizeHint\fR () const = 0".br.ti -1c.BI "virtual QSize \fBminimumSize\fR () const = 0".br.ti -1c.BI "virtual QSize \fBmaximumSize\fR () const = 0".br.ti -1c.BI "virtual QSizePolicy::ExpandData \fBexpanding\fR () const = 0".br.ti -1c.BI "virtual void \fBsetGeometry\fR ( const QRect & r ) = 0".br.ti -1c.BI "virtual QRect \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 QWidget * \fBwidget\fR ()".br.ti -1c.BI "virtual QLayoutIterator \fBiterator\fR ()".br.ti -1c.BI "virtual QLayout * \fBlayout\fR ()".br.ti -1c.BI "virtual QSpacerItem * \fBspacerItem\fR ()".br.ti -1c.BI "int \fBalignment\fR () const".br.ti -1c.BI "virtual void \fBsetAlignment\fR ( int a )".br.in -1c.SH DESCRIPTIONThe QLayoutItem class provides an abstract item that a QLayout manipulates..PPThis is used by custom layouts..PPPure virtual functions are provided to return information about the layout, including, sizeHint(), minimumSize(), maximumSize() and expanding()..PPThe layout's geometry can be set and retrieved with setGeometry() and geometry(), and its alignment with setAlignment() and alignment()..PPisEmpty() returns whether the layout is empty. iterator() returns an iterator for the layout's children. If the concrete item is a QWidget, it can be retrieved using widget(). Similarly for layout() and spacerItem()..PPSee also QLayout, Widget Appearance and Style, and Layout Management..SH MEMBER FUNCTION DOCUMENTATION.SH "QLayoutItem::QLayoutItem ( int alignment = 0 )"Constructs a layout item with an \fIalignment\fR that is a bitwise OR of the Qt::AlignmentFlags. Not all subclasses support alignment..SH "QLayoutItem::~QLayoutItem ()\fC [virtual]\fR"Destroys the QLayoutItem..SH "int QLayoutItem::alignment () const"Returns the alignment of this item..SH "QSizePolicy::ExpandData QLayoutItem::expanding () const\fC [pure virtual]\fR"Implemented in subclasses to return the direction(s) this item" wants" to expand in (if any)..PPReimplemented in QLayout, QSpacerItem, and QWidgetItem..SH "QRect QLayoutItem::geometry () const\fC [pure virtual]\fR"Returns the rectangle covered by this layout item..PPExample: customlayout/border.cpp..SH "bool QLayoutItem::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..PPReimplement this function in layout managers that support height for width..PPSee also heightForWidth() and QWidget::heightForWidth()..PPExamples:.)l customlayout/border.cpp and customlayout/flow.cpp..PPReimplemented in QGridLayout and QBoxLayout..SH "int QLayoutItem::heightForWidth ( int w ) const\fC [virtual]\fR"Returns the preferred height for this layout item, given the width \fIw\fR..PPThe 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..PPReimplement 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.PPCaching is strongly recommended; without it layout will take exponential time..PPSee also hasHeightForWidth()..PPExample: customlayout/flow.cpp..PPReimplemented in QGridLayout and QBoxLayout..SH "void QLayoutItem::invalidate ()\fC [virtual]\fR"Invalidates any cached information in this layout item..PPReimplemented in QLayout..SH "bool QLayoutItem::isEmpty () const\fC [pure virtual]\fR"Implemented in subclasses to return whether this item is empty, i.e. whether it contains any widgets..PPReimplemented in QLayout, QSpacerItem, and QWidgetItem..SH "QLayoutIterator QLayoutItem::iterator ()\fC [virtual]\fR"Returns an iterator over this item's QLayoutItem children. The default implementation returns an empty iterator..PPReimplement this function in subclasses that can have children..PPReimplemented in QLayout..SH "QLayout * QLayoutItem::layout ()\fC [virtual]\fR"If this item is a QLayout, it is returned as a QLayout; otherwise 0 is returned. This function provides type-safe casting..SH "QSize QLayoutItem::maximumSize () const\fC [pure virtual]\fR"Implemented in subclasses to return the maximum size of this item..PPReimplemented in QLayout, QSpacerItem, and QWidgetItem..SH "QSize QLayoutItem::minimumSize () const\fC [pure virtual]\fR"Implemented in subclasses to return the minimum size of this item..PPExamples:.)l customlayout/border.cpp, customlayout/card.cpp, and customlayout/flow.cpp..PPReimplemented in QLayout, QSpacerItem, and QWidgetItem..SH "void QLayoutItem::setAlignment ( int a )\fC [virtual]\fR"Sets the alignment of this item to \fIa\fR, which is a bitwise OR of the Qt::AlignmentFlags. Not all subclasses support alignment..PPExample: chart/optionsform.cpp..SH "void QLayoutItem::setGeometry ( const QRect & r )\fC [pure virtual]\fR"Implemented in subclasses to set this item's geometry to \fIr\fR..PPExamples:.)l customlayout/border.cpp, customlayout/card.cpp, and customlayout/flow.cpp..PPReimplemented in QLayout, QSpacerItem, and QWidgetItem..SH "QSize QLayoutItem::sizeHint () const\fC [pure virtual]\fR"Implemented in subclasses to return the preferred size of this item..PPExamples:.)l customlayout/border.cpp, customlayout/card.cpp, and customlayout/flow.cpp..PPReimplemented in QSpacerItem, QWidgetItem, QGridLayout, and QBoxLayout..SH "QSpacerItem * QLayoutItem::spacerItem ()\fC [virtual]\fR"If this item is a QSpacerItem, it is returned as a QSpacerItem; otherwise 0 is returned. This function provides type-safe casting..SH "QWidget * QLayoutItem::widget ()\fC [virtual]\fR"If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned. This function provides type-safe casting..PPReimplemented in QWidgetItem..SH "SEE ALSO".BR http://doc.trolltech.com/qlayoutitem.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf 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..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qlayoutitem.3qt) and the Qtversion (3.1.1).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -