📄 qlayoutitem.3qt
字号:
.TH QLayoutItem 3qt "10 November 2000" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2000 Trolltech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQLayoutItem \- The abstract items which a QLayout manipulates.SH SYNOPSIS.br.PP\fC#include <qabstractlayout.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".br.ti -1c.BI "virtual QSize \fBminimumSize\fR () const".br.ti -1c.BI "virtual QSize \fBmaximumSize\fR () const".br.ti -1c.BI "virtual QSizePolicy::ExpandData \fBexpanding\fR () const".br.ti -1c.BI "virtual void \fBsetGeometry\fR ( const QRect & ) ".br.ti -1c.BI "virtual QRect \fBgeometry\fR () const".br.ti -1c.BI "virtual bool \fBisEmpty\fR () const".br.ti -1c.BI "virtual bool \fBhasHeightForWidth\fR () const".br.ti -1c.BI "virtual int \fBheightForWidth\fR ( int ) 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 abstract items which a QLayout manipulates..PPFor custom layouts..PPSee also QLayout..SH MEMBER FUNCTION DOCUMENTATION.SH "QLayoutItem::QLayoutItem ( int alignment = 0 )"Constructs a layout item with an \fIalignment\fR that is a bitwise OR of Qt::AlignmentFlags. Alignment may not be supported by all subclasses..SH "QLayoutItem::~QLayoutItem () \fC[virtual]\fR"Destructs the QLayoutItem..SH "int QLayoutItem::alignment () const"Returns the alignment of this item..SH "QSizePolicy::ExpandData QLayoutItem::expanding() const \fC[virtual]\fR"Implemented in subclasses to return whether this item "wants" to expand..PPReimplemented in QSpacerItem, QWidgetItem, QBoxLayout, QGridLayout and QLayout..SH "QRect QLayoutItem::geometry () const \fC[virtual]\fR"Returns the rectangle covered by this layout item..PPReimplemented in QWidgetItem, QLayout and QSpacerItem..SH "bool QLayoutItem::hasHeightForWidth () const \fC[virtual]\fR"Returns TRUE if this layout's preferred height depends on its width. The default implementation returns FALSE;.PPReimplement this function in layout managers that support height for width..PPSee also heightForWidth() and QWidget::heightForWidth()..PPReimplemented in QBoxLayout, QGridLayout and QWidgetItem..SH "int QLayoutItem::heightForWidth ( int ) 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" yet:.br MyLayout * mthis = (MyLayout*)this;.br int h = calculateHeightForWidth( w );.br mthis->cached_hfw = h;.br return h;.br }.br return cached_hfw;.br }.fi.PPCaching is strongly recommended, without it layout will take exponential time..PPSee also hasHeightForWidth()..PPReimplemented in QGridLayout, QWidgetItem and QBoxLayout..SH "void QLayoutItem::invalidate () \fC[virtual]\fR"Invalidates any cached information in this layout item..PPReimplemented in QBoxLayout, QLayout and QGridLayout..SH "virtual bool QLayoutItem::isEmpty () const \fC[virtual]\fR"Implemented in subclasses to return whether this item is empty, i.e. whether it contains any widgets..PPReimplemented in QLayout, QWidgetItem and QSpacerItem..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 QGridLayout, QLayout and QBoxLayout..SH "QLayout * QLayoutItem::layout () \fC[virtual]\fR"If this item is a QLayout, return it as a QLayout, otherwise return 0. This function provides type-safe casting..PPReimplemented in QLayout..SH "QSize QLayoutItem::maximumSize () const \fC[virtual]\fR"Implemented in subclasses to return the maximum size of this item..PPReimplemented in QLayout, QSpacerItem, QGridLayout, QWidgetItem and QBoxLayout..SH "QSize QLayoutItem::minimumSize () const \fC[virtual]\fR"Implemented in subclasses to return the minimum size of this item..PPReimplemented in QSpacerItem, QGridLayout, QBoxLayout, QLayout 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 Qt::AlignmentFlags..SH "void QLayoutItem::setGeometry ( const QRect & r ) \fC[virtual]\fR"Implemented in subclasses to set this item's geometry to \fIr.\fR.PPReimplemented in QWidgetItem, QBoxLayout, QGridLayout, QLayout and QSpacerItem..SH "QSize QLayoutItem::sizeHint () const \fC[virtual]\fR"Implemented in subclasses to return the preferred size of this item..PPReimplemented in QWidgetItem, QBoxLayout, QSpacerItem and QGridLayout..SH "QSpacerItem * QLayoutItem::spacerItem () \fC[virtual]\fR"If this item is a QSpacerItem, return it as a QSpacerItem, otherwise return 0. This function provides type-safe casting..PPReimplemented in QSpacerItem..SH "QWidget * QLayoutItem::widget () \fC[virtual]\fR"If this item is a QWidgetItem, the managed widget is returned.The default implementation returns 0;..SH "SEE ALSO".BR http://doc.trolltech.com/qlayoutitem.html.SH COPYRIGHTCopyright 1992-2000 Trolltech AS, http://www.trolltech.com/. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -