📄 qlayout.3qt
字号:
.TH QLayout 3qt "6 July 1999" "Troll Tech AS" \" -*- nroff -*-.\" Copyright 1992-1999 Troll Tech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQLayout \- The base class of geometry specifiers.SH SYNOPSIS.br.PP\fC#include <qabstractlayout.h>\fR.PPInherits QLayoutItem and QObject..PPInherited by QBoxLayout and QGridLayout..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQLayout\fR ( QWidget * " "parent" ", int " "border" "=0, int " "space" "=-1, const char * " "name" "=0 )".br.ti -1c.BI "\fBQLayout\fR ( QLayout * " "parentLayout" ", int " "space" "=-1, const char * " "name" "=0 )".br.ti -1c.BI "\fBQLayout\fR ( int " "space" "=-1, const char * " "name" "=0 )".br.ti -1c.BI "\fB~QLayout\fR ()".br.ti -1c.BI "int \fBspacing\fR () const".br.ti -1c.BI "int \fBmargin\fR () const".br.ti -1c.BI "virtual void \fBsetMargin\fR ( int )".br.ti -1c.BI "virtual void \fBsetSpacing\fR ( int )".br.ti -1c.BI "enum { unlimited = QWIDGETSIZE_MAX }".br.ti -1c.BI "enum \fBResizeMode\fR { FreeResize, Minimum, Fixed }".br.ti -1c.BI "void \fBsetResizeMode\fR ( ResizeMode )".br.ti -1c.BI "ResizeMode \fBresizeMode\fR () const".br.ti -1c.BI "virtual void \fBsetMenuBar\fR ( QMenuBar * w )".br.ti -1c.BI "QWidget* \fBmainWidget\fR ()".br.ti -1c.BI "QMenuBar* \fBmenuBar\fR () const".br.ti -1c.BI "bool \fBisTopLevel\fR () const".br.ti -1c.BI "virtual void \fBsetAutoAdd\fR ( bool )".br.ti -1c.BI "bool \fBautoAdd\fR () const".br.ti -1c.BI "virtual QRect \fBgeometry\fR () const".br.ti -1c.BI "bool \fBactivate\fR ()".br.ti -1c.BI "void \fBadd\fR ( QWidget * w )".br.ti -1c.BI "virtual void \fBaddItem\fR ( QLayoutItem * )".br.ti -1c.BI "virtual QSizePolicy::ExpandData \fBexpanding\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 void \fBsetGeometry\fR ( const QRect & )".br.ti -1c.BI "virtual QLayoutIterator \fBiterator\fR ()".br.ti -1c.BI "virtual bool \fBisEmpty\fR () const".br.ti -1c.BI "int \fBtotalHeightForWidth\fR ( int w ) const".br.ti -1c.BI "QSize \fBtotalMinimumSize\fR () const".br.ti -1c.BI "QSize \fBtotalMaximumSize\fR () const".br.ti -1c.BI "QSize \fBtotalSizeHint\fR () const".br.ti -1c.BI "virtual QLayout* \fBlayout\fR ()".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual bool \fBeventFilter\fR ( QObject *, QEvent * )".br.ti -1c.BI "void \fBaddChildLayout\fR ( QLayout * l )".br.ti -1c.BI "void \fBdeleteAllItems\fR ()".br.in -1c.SH DESCRIPTIONThe QLayout class is the base class of geometry specifiers..PPThis is an abstract base class. The concrete layout managers QBoxLayout and QGridLayout inherit from this one..PPMost users of Q*Layout are likely to use some of the basic functions provided by QLayout, such as setMenuBar(), which is necessary to manage a menu bar because of the special properties of menu bars, and freeze(), which allows you to freeze the widget's size and layout..PPTo make your own layout manager, make a subclass of QGLayoutIterator and implement the functions addItem(), sizeHint(), setGeometry() and iterator(). You should also implement minimumSize(), otherwise your layout will be resized to zero size if there is little space. To support children whose height depend on their widths, implement hasHeightForWidth() and heightForWidth(). See the custom layout page for an in-depth description..PPGeometry management stops when the layout manager is deleted..SS "Member Type Documentation".SH "QLayout::ResizeMode"The possible values are are:.TP\fCFixed\fR - the main widget's size is set to <a href="qlayout.html#1f01ad">sizeHint(), it cannot be resized at all..TP\fCMinimum\fR - The main widget's minimum size is set to minimumSize(), it cannot be smaller..TP\fCFreeResize\fR - the widget is not constrained..SH MEMBER FUNCTION DOCUMENTATION.SH "QLayout::QLayout ( QWidget * parent, int border=0, int space=-1, const char * name=0 )"Creates a new top-level QLayout with main widget \fIparent. parent\fR may not be 0..PP\fIborder\fR is the number of pixels between the edge of the widget and the managed children. \fIspace\fR sets the value of spacing(), which gives the spacing between widgets. The default value for \fIspace\fR is -1, which means that the value of \fIborder\fR is used..PP\fIname\fR is the internal object name.PPThere can only be one top-level layout for a widget. It is returned by QWidget::layout()..SH "QLayout::QLayout ( QLayout * parentLayout, int space=-1, const char * name=0 )"Constructs a new child QLayout, and places it inside \fIparentLayout,\fR using the default placement defined by addItem()..PPIf \fIspace\fR is -1, this QLayout inherits \fIparentLayout's\fR spacing(), otherwise \fIspace\fR is used..SH "QLayout::QLayout ( int space=-1, const char * name=0 )"Constructs a new child QLayout, If \fIspace\fR is -1, this QLayout inherits its parent's spacing(), otherwise \fIspace\fR is used..PPThis layout has to be inserted into another layout before geometry management will work..SH "QLayout::~QLayout ()"Deletes all layout children. Geometry management stops when a toplevel layout is deleted..SH "bool QLayout::activate ()"Redoes the layout for mainWidget(). You should generally not need to call this, as it is automatically called at most appropriate times..PPHowever, if you set up a QLayout for a visible widget without resizing that widget, you need to call this function in order to lay it out..PPSee also: QWidget::updateGeometry()..PPExamples:.(llayout/layout.cpp popup/popup.cpp scrollview/scrollview.cpp.)l.SH "void QLayout::add ( QWidget * w )"Adds \fIw\fR to this layout in a manner specific to the layout. This function uses addItem..PPExamples:.(lcustomlayout/main.cpp.)l.SH "void QLayout::addChildLayout ( QLayout * l ) \fC[protected]\fR"This function is called from addLayout functions in subclasses, to add \fIl\fR layout as a sublayout..SH "void QLayout::addItem ( QLayoutItem * item ) \fC[virtual]\fR"Implemented in subclasses to add \fIitem.\fR How it is added is specific to each subclass..PPNote that the ownership of \fIitem\fR is transferred to the layout, and it is the layout's responsibility to delete it..PPReimplemented in QGridLayout and QBoxLayout..SH "bool QLayout::autoAdd () const"Returns TRUE if this layout automatically grabs all new mainWidget()'s new children and adds them as defined by addItem(). This only has effect for top-level layouts, ie. layouts that are direct children of their mainWidget()..PPautoAdd() is disabled by default..PPSee also: setAutoAdd()..SH "void QLayout::deleteAllItems () \fC[protected]\fR"Removes and deletes all items in this layout..SH "bool QLayout::eventFilter ( QObject * o, QEvent * e ) \fC[virtual protected]\fR"Performs child widget layout when the parent widget is resized. Also handles removal of widgets and child layouts..PPReimplemented from QObject..SH "QRect QLayout::geometry () const \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QLayoutItem..SH "bool QLayout::isEmpty () const \fC[virtual]\fR"Returns TRUE if this layout is empty. The default implementation returns FALSE..PPReimplemented from QLayoutItem..SH "bool QLayout::isTopLevel () const"Returns TRUE if this layout is a top level layout, i.e. not a child of another layout..SH "QLayout * QLayout::layout () \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QLayoutItem..SH "QWidget * QLayout::mainWidget ()"Returns the main widget (parent widget) of this layout, or 0 if this layout is a sub-layout which is not yet inserted..SH "int QLayout::margin () const"returns the width of the outside border of the layout..PPSee also: spacing() and setMargin()..SH "QSize QLayout::maximumSize () const \fC[virtual]\fR"Returns the maximum size of this layout. This is the largest size that the layout can have, while still respecting the specifications. Does not include what's needed by margin() or menuBar()..PPThe default implementation allows unlimited resizing..PPReimplemented from QLayoutItem..SH "QMenuBar* QLayout::menuBar () const"Returns the menu bar set for this layout, or a null pointer if no menu bar is set..SH "QSize QLayout::minimumSize () const \fC[virtual]\fR"Returns the minimum size of this layout. This is the smallest size that the layout can have, while still respecting the specifications. Does not include what's needed by margin() or menuBar()..PPThe default implementation allows unlimited resizing..PPReimplemented from QLayoutItem..SH "QLayout::ResizeMode QLayout::resizeMode() const"Returns the resize mode..SH "void QLayout::setAutoAdd ( bool b ) \fC[virtual]\fR"Sets autoAdd() if \fIb\fR is TRUE..PPSee also: autoAdd()..SH "void QLayout::setGeometry ( const QRect & r ) \fC[virtual]\fR"This function is reimplemented in subclasses to perform layout..PPThe default implementation maintains the geometry() information. Reimplementors must call this function..PPReimplemented from QLayoutItem..SH "void QLayout::setMargin ( int border ) \fC[virtual]\fR"Sets the outside border of the layout to \fIborder.\fR.PPSee also: margin() and setSpacing()..SH "void QLayout::setMenuBar ( QMenuBar * w ) \fC[virtual]\fR"Makes the geometry manager take account of the menu bar \fIw.\fR All child widgets are placed below the bottom edge of the menu bar..PPA menu bar does its own geometry managing, never do addWidget() on a QMenuBar..PPExamples:.(lscrollview/scrollview.cpp.)l.SH "void QLayout::setResizeMode ( ResizeMode mode )"Sets the resize mode to \fImode.\fR.PPThe default mode is \fCMinimum\fR for top level widgets, and \fCFreeResize\fR for all others..PPSee also: QLayout::ResizeMode..SH "void QLayout::setSpacing ( int space ) \fC[virtual]\fR"Sets the internal spacing of the layout to \fIspace.\fR.PPSee also: spacing() and setMargin()..SH "int QLayout::spacing () const"Returns the spacing between widgets inside the layout..PPSee also: margin() and setSpacing()..SH "int QLayout::totalHeightForWidth ( int w ) const"For internal use only..SH "QSize QLayout::totalMaximumSize () const"For internal use only..SH "QSize QLayout::totalMinimumSize () const"For internal use only..SH "QSize QLayout::totalSizeHint () const"For internal use only..SH "SEE ALSO".BR http://www.troll.no/qt/qlayout.html.SH COPYRIGHTCopyright 1992-1999 Troll Tech AS. See the license file included inthe distribution for a complete license statement..SH AUTHORGenerated automatically from the source code.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -