qboxlayout.3qt

来自「tmark1.11:用于生成QT/EMBEDDED应用工程的Markfile文件」· 3QT 代码 · 共 224 行

3QT
224
字号
.TH QBoxLayout 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 NAMEQBoxLayout \- Lines up child widgets horizontally or vertically.SH SYNOPSIS.br.PP\fC#include <qlayout.h>\fR.PPInherits QLayout..PPInherited by QHBoxLayout and QVBoxLayout..PP.SS "Public Members".in +1c.ti -1c.BI "enum \fBDirection\fR { LeftToRight, RightToLeft, TopToBottom, BottomToTop, Down = TopToBottom, Up = BottomToTop }".br.ti -1c.BI "\fBQBoxLayout\fR ( QWidget * " "parent" ", Direction, int " "border" "=0, int " "space" " = -1, const char * " "name" "=0 )".br.ti -1c.BI "\fBQBoxLayout\fR ( QLayout * " "parentLayout" ", Direction, int " "space" " = -1, const char * " "name" "=0 )".br.ti -1c.BI "\fBQBoxLayout\fR ( Direction, int " "space" " = -1, const char * " "name" "=0 )".br.ti -1c.BI "\fB~QBoxLayout\fR ()".br.ti -1c.BI "virtual void \fBaddItem\fR ( QLayoutItem * )".br.ti -1c.BI "Direction \fBdirection\fR () const".br.ti -1c.BI "void \fBaddSpacing\fR ( int size )".br.ti -1c.BI "void \fBaddStretch\fR ( int " "stretch" " = 0 )".br.ti -1c.BI "void \fBaddWidget\fR ( QWidget *, int " "stretch" " = 0, int " "alignment" " = 0 )".br.ti -1c.BI "void \fBaddLayout\fR ( QLayout * " "layout" ", int " "stretch" " = 0 )".br.ti -1c.BI "void \fBaddStrut\fR ( int )".br.ti -1c.BI "bool \fBsetStretchFactor\fR ( QWidget *, int stretch )".br.ti -1c.BI "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 bool \fBhasHeightForWidth\fR () const".br.ti -1c.BI "virtual int \fBheightForWidth\fR ( int ) const".br.ti -1c.BI "virtual QSizePolicy::ExpandData \fBexpanding\fR () const".br.ti -1c.BI "virtual void \fBinvalidate\fR ()".br.ti -1c.BI "virtual QLayoutIterator \fBiterator\fR ()".br.ti -1c.BI "virtual void \fBsetGeometry\fR ( const QRect & )".br.in -1c.SH DESCRIPTIONThe QBoxLayout class lines up child widgets horizontally or vertically..PPQBoxLayout takes the space it gets (from its parent layout or from the mainWidget()), divides it up into a row of boxes and makes each managed widget fill one box..PPIf the QBoxLayout is \fCHorizontal,\fR the boxes are beside each other, with suitable sizes. Each widget (or other box) will get at least its minimum sizes and at most its maximum size, and any excess space is shared according to the stretch factors (more about that below)..PPIf the QBoxLayout is \fCVertical,\fR the boxes are above and below each other, again with suitable sizes..PPThe easiest way to create a QBoxLayout is to use one of the convenience classes QHBoxLayout (for \fCHorizontal\fR boxes) or QVBoxLayout (for \fCVertical\fR boxes). You can also use the QBoxLayout constructor directly, specifying its direction as \fCLeftToRight, Down, RightToLeft\fR or \fCUp.\fR.PPIf the QBoxLayout is not the top-level layout (ie. is not managing all of the widget's area and children), you must add it to its parent layout before you can do anything with it. The normal way to add a layout is by calling parentLayout->addLayout()..PPOnce you have done that, you can add boxes to the QBoxLayout using one of four functions: .IP.TPaddWidget() to add a widget to the QBoxLayout and set the widget's stretch factor. (The stretch factor is along the row of boxes.).IP.TPaddSpacing() to create an empty box; this is one of the functions you use to create nice and spacious dialogs. See below for ways to set margins..IP.TPaddStretch() to create an empty, stretchable box..IP.TPaddLayout() to add a box containing another QLayout to the row and set that layout's stretch factor..IP.PPQBoxLayout also includes two margin widths: The border width and the inter-box width. The border width is the width of the reserved space along each of the QBoxLayout's four sides. The intra-widget width is the width of the automatically allocated spacing between neighbouring boxes. (You can use addSpacing() to get more space.).PPThe border width defaults to 0, and the intra-widget width defaults to the same as the border width. Both are set using arguments to the constructor..PPYou will almost always want to use the convenience classes for QBoxLayout: QVBoxLayout and QHBoxLayout, because of their simpler constructors..PPExamples:.(llayout/layout.cpp popup/popup.cpp customlayout/main.cpp.)l.SH MEMBER FUNCTION DOCUMENTATION.SH "QBoxLayout::QBoxLayout ( QLayout * parentLayout, Direction d, int space = -1, const char * name=0 )"Creates a new QBoxLayout with direction \fId\fR and inserts it into \fIparentLayout.\fR.SH "QBoxLayout::QBoxLayout ( QWidget * parent, Direction d, int border=0, int space = -1, const char * name=0 )"Creates a new QBoxLayout with direction \fId\fR and 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 is the default number of pixels between neighbouring children. If \fIspace\fR is -1 the value of \fIborder\fR is used..PP\fIname\fR is the internal object name.PPSee also: direction()..SH "QBoxLayout::QBoxLayout ( Direction d, int space = -1, const char * name=0 )"If \fIspace\fR is -1, this QBoxLayout will inherit its parent's spacing(), otherwise \fIspace\fR is used..PPYou have to insert this box into another layout..PPExamples:.(llayout/layout.cpp.)l.SH "QBoxLayout::~QBoxLayout ()"Destroys this box..SH "void QBoxLayout::addItem ( QLayoutItem * item ) \fC[virtual]\fR"Adds \fIitem\fR to this box..PPReimplemented from QLayout..SH "void QBoxLayout::addLayout ( QLayout * layout, int stretch = 0 )"Adds \fIlayout\fR to the box, with serial stretch factor \fIstretch.\fR.PPSee also: setAutoAdd(), addWidget() and addSpacing()..SH "void QBoxLayout::addSpacing ( int size )"Adds a non-stretchable space with size \fIsize.\fR QBoxLayout gives default border and spacing. This function adds additional space..PPSee also: addStretch()..SH "void QBoxLayout::addStretch ( int stretch = 0 )"Adds a stretchable space with zero minimum size and stretch factor \fIstretch.\fR.PPSee also: addSpacing()..SH "void QBoxLayout::addStrut ( int size )"Limits the perpendicular dimension of the box (e.g. height if the box is LeftToRight) to a minimum of \fIsize.\fR Other constraints may increase the limit..SH "void QBoxLayout::addWidget ( QWidget * widget, int stretch = 0, int alignmnt = 0 )"Adds \fIwidget\fR to the box, with stretch factor \fIstretch\fR and alignment \fIalignmnt.\fR.PPThe stretch factor applies only in the direction of the QBoxLayout, and is relative to the other boxes and widgets in this QBoxLayout. Widgets and boxes with higher stretch factor grow more..PPIf the stretch factor is 0 and nothing else in the QBoxLayout has a stretch factor greater than zero, the space is distributed according to the QWidget:sizePolicy() of each widget that's involved..PPThe default alignment is 0, which means that the widget fills the entire cell..PPNote: The alignment parameter is interpreted more aggressively than in previous versions of Qt. A non-default alignment now indicates that the widget should not grow to fill the available space, but should be sized according to sizeHint()..PPSee also: setAutoAdd(), addLayout() and addSpacing()..PPExamples:.(llayout/layout.cpp popup/popup.cpp scrollview/scrollview.cpp customlayout/main.cpp.)l.SH "bool QBoxLayout::hasHeightForWidth () const \fC[virtual]\fR"Returns whether this layout's preferred height depends on its width..PPReimplemented from QLayoutItem..SH "int QBoxLayout::heightForWidth ( int w ) const \fC[virtual]\fR"Returns the layout's preferred height when it is \fIw\fR pixels wide..PPReimplemented from QLayoutItem..SH "void QBoxLayout::invalidate () \fC[virtual]\fR"Resets cached information..PPReimplemented from QLayoutItem..SH "QLayoutIterator QBoxLayout::iterator () \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QLayoutItem..SH "QSize QBoxLayout::maximumSize () const \fC[virtual]\fR"Returns the maximum size needed by this box..PPReimplemented from QLayoutItem..SH "QSize QBoxLayout::minimumSize () const \fC[virtual]\fR"Returns the minimum size needed by this box..PPReimplemented from QLayoutItem..SH "void QBoxLayout::setGeometry ( const QRect & s ) \fC[virtual]\fR"Resizes managed widgets within the rectangle \fIs.\fR.PPReimplemented from QLayoutItem..SH "bool QBoxLayout::setStretchFactor ( QWidget * w, int stretch )"Sets the stretch factor for widget \fIw\fR to \fIstretch\fR and returns TRUE, if \fIw\fR is found in this layout (not including child layouts)..PPReturns FALSE if \fIw\fR is not found..SH "QSize QBoxLayout::sizeHint () const"Returns the preferred size of this grid..SH "SEE ALSO".BR http://www.troll.no/qt/qboxlayout.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 + =
减小字号Ctrl + -
显示快捷键?