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

📄 qboxlayout.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
📖 第 1 页 / 共 2 页
字号:
'\" t.TH QBoxLayout 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 NAMEQBoxLayout \- Lines up child widgets horizontally or vertically.SH SYNOPSIS\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 d, int margin = 0, int spacing = -1, const char * name = 0 )".br.ti -1c.BI "\fBQBoxLayout\fR ( QLayout * parentLayout, Direction d, int spacing = -1, const char * name = 0 )".br.ti -1c.BI "\fBQBoxLayout\fR ( Direction d, int spacing = -1, const char * name = 0 )".br.ti -1c.BI "\fB~QBoxLayout\fR ()".br.ti -1c.BI "virtual void \fBaddItem\fR ( QLayoutItem * item )".br.ti -1c.BI "Direction \fBdirection\fR () const".br.ti -1c.BI "void \fBsetDirection\fR ( Direction direction )".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 * widget, 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 size )".br.ti -1c.BI "void \fBinsertSpacing\fR ( int index, int size )".br.ti -1c.BI "void \fBinsertStretch\fR ( int index, int stretch = 0 )".br.ti -1c.BI "void \fBinsertWidget\fR ( int index, QWidget * widget, int stretch = 0, int alignment = 0 )".br.ti -1c.BI "void \fBinsertLayout\fR ( int index, QLayout * layout, int stretch = 0 )".br.ti -1c.BI "bool \fBsetStretchFactor\fR ( QWidget * w, int stretch )".br.ti -1c.BI "bool \fBsetStretchFactor\fR ( QLayout * l, int stretch )".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 bool \fBhasHeightForWidth\fR () const".br.ti -1c.BI "virtual int \fBheightForWidth\fR ( int w ) const".br.ti -1c.BI "virtual QSizePolicy::ExpandData \fBexpanding\fR () const".br.ti -1c.BI "virtual void \fBinvalidate\fR ()".br.ti -1c.BI "virtual void \fBsetGeometry\fR ( const QRect & r )".br.ti -1c.BI "int \fBfindWidget\fR ( QWidget * w )".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "void \fBinsertItem\fR ( int index, QLayoutItem * item )".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..PP<center>.ce 1.B "[Image Omitted]".PP</center>.PPIf the QBoxLayout's orientation is Horizontal the boxes are placed in a row, with suitable sizes. Each widget (or other box) will get at least its minimum size and at most its maximum size. Any excess space is shared according to the stretch factors (more about that below)..PP<center>.ce 1.B "[Image Omitted]".PP</center>.PPIf the QBoxLayout's orientation is Vertical, the boxes are placed in a column, again with suitable sizes..PPThe easiest way to create a QBoxLayout is to use one of the convenience classes, e.g. QHBoxLayout (for Horizontal boxes) or QVBoxLayout (for Vertical boxes). You can also use the QBoxLayout constructor directly, specifying its direction as LeftToRight, Down, RightToLeft or Up..PPIf the QBoxLayout is not the top-level layout (i.e. it 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 this, you can add boxes to the QBoxLayout using one of four functions:.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..PPUse insertWidget(), insertSpacing(), insertStretch() or insertLayout() to insert a box at a specified position in the layout..PPQBoxLayout also includes two margin widths:.TPsetMargin() sets the width of the outer border. This is the width of the reserved space along each of the QBoxLayout's four sides..TPsetSpacing() sets the width between neighboring boxes. (You can use addSpacing() to get more space at a particular spot.).PPThe margin defaults to 0. The spacing defaults to the same as the margin width for a top-level layout, or to the same as the parent layout. Both are parameters to the constructor..PPTo remove a widget from a layout, call removeWidget(). Calling QWidget::hide() on a widget also effectively removes the widget from the layout until QWidget::show() is called..PPYou will almost always want to use QVBoxLayout and QHBoxLayout rather than QBoxLayout because of their convenient constructors..PPSee also QGrid, Layout Overview, Widget Appearance and Style, and Layout Management..SS "Member Type Documentation".SH "QBoxLayout::Direction"This type is used to determine the direction of a box layout..TP\fCQBoxLayout::LeftToRight\fR - Horizontal, from left to right.TP\fCQBoxLayout::RightToLeft\fR - Horizontal, from right to left.TP\fCQBoxLayout::TopToBottom\fR - Vertical, from top to bottom.TP\fCQBoxLayout::Down\fR - The same as TopToBottom.TP\fCQBoxLayout::BottomToTop\fR - Vertical, from bottom to top

⌨️ 快捷键说明

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