📄 qboxlayout.html
字号:
</h3>Adds <em>item</em> to the end of this box layout.<p>Examples: <a href="tutorial2-09.html#x2534">chart/optionsform.cpp</a> and <a href="tutorial2-08.html#x2498">chart/setdataform.cpp</a>.<p>Reimplemented from <a href="qlayout.html#addItem">QLayout</a>.<h3 class=fn>void <a name="addLayout"></a>QBoxLayout::addLayout ( <a href="qlayout.html">QLayout</a> * layout, int stretch = 0 )</h3>Adds <em>layout</em> to the end of the box, with serial <a href="layout.html#stretch-factor">stretch factor</a><em>stretch</em>.<p> <p>See also <a href="#insertLayout">insertLayout</a>(), <a href="qlayout.html#setAutoAdd">setAutoAdd</a>(), <a href="#addWidget">addWidget</a>() and <a href="#addSpacing">addSpacing</a>().<p>Examples: <a href="tutorial2-09.html#x2535">chart/optionsform.cpp</a>, <a href="tutorial2-08.html#x2499">chart/setdataform.cpp</a>, <a href="simple-qfont-demo-walkthrough.html#x2107">fonts/simple-qfont-demo/viewer.cpp</a>, <a href="listbox-example.html#x1305">listbox/listbox.cpp</a> and <a href="tictac-example.html#x115">tictac/tictac.cpp</a>.<h3 class=fn>void <a name="addSpacing"></a>QBoxLayout::addSpacing ( int size )</h3>Adds a non-stretchable space with size <em>size</em> to the end of thisbox layout. QBoxLayout provides default margin and spacing. Thisfunction adds additional space.<p> <p>See also <a href="#insertSpacing">insertSpacing</a>() and <a href="#addStretch">addStretch</a>().<p>Example: <a href="listbox-example.html#x1306">listbox/listbox.cpp</a>.<h3 class=fn>void <a name="addStretch"></a>QBoxLayout::addStretch ( int stretch = 0 )</h3>Adds a stretchable space with zero minimum size and <a href="layout.html#stretch-factor">stretch factor</a><em>stretch</em> to the end of this box layout.<p> <p>See also <a href="#addSpacing">addSpacing</a>().<p>Examples: <a href="layout-example.html#x479">layout/layout.cpp</a>, <a href="listbox-example.html#x1307">listbox/listbox.cpp</a> and <a href="tutorial1-13.html#x2397">t13/gamebrd.cpp</a>.<h3 class=fn>void <a name="addStrut"></a>QBoxLayout::addStrut ( int size )</h3>Limits the perpendicular dimension of the box (e.g. height if thebox is LeftToRight) to a minimum of <em>size</em>. Other constraints mayincrease the limit.<h3 class=fn>void <a name="addWidget"></a>QBoxLayout::addWidget ( <a href="qwidget.html">QWidget</a> * widget, int stretch = 0, int alignment = 0 )</h3>Adds <em>widget</em> to the end of this box layout, with a <a href="layout.html#stretch-factor">stretch factor</a> of <em>stretch</em> and alignment <em>alignment</em>.<p> The stretch factor applies only in the <a href="#direction">direction</a> of the QBoxLayout, and is relative to the other boxes andwidgets in this QBoxLayout. Widgets and boxes with higher stretchfactors grow more.<p> If the stretch factor is 0 and nothing else in the QBoxLayout hasa stretch factor greater than zero, the space is distributedaccording to the QWidget:sizePolicy() of each widget that'sinvolved.<p> Alignment is specified by <em>alignment</em> which is a bitwise OR of <a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a> values. The default alignment is 0, which meansthat the widget fills the entire cell.<p> From Qt 3.0, the <em>alignment</em> parameter is interpreted moreaggressively than in previous versions of Qt. A non-defaultalignment now indicates that the widget should not grow to fillthe available space, but should be sized according to <a href="#sizeHint">sizeHint</a>().<p> <p>See also <a href="#insertWidget">insertWidget</a>(), <a href="qlayout.html#setAutoAdd">setAutoAdd</a>(), <a href="#addLayout">addLayout</a>() and <a href="#addSpacing">addSpacing</a>().<p>Examples: <a href="tutorial2-09.html#x2536">chart/optionsform.cpp</a>, <a href="simple-qfont-demo-walkthrough.html#x2108">fonts/simple-qfont-demo/viewer.cpp</a>, <a href="layout-example.html#x480">layout/layout.cpp</a>, <a href="lineedits-example.html#x99">lineedits/lineedits.cpp</a>, <a href="listbox-example.html#x1308">listbox/listbox.cpp</a>, <a href="tutorial1-13.html#x2398">t13/gamebrd.cpp</a> and <a href="tutorial1-13.html#x2388">t13/lcdrange.cpp</a>.<h3 class=fn><a href="qboxlayout.html#Direction-enum">Direction</a> <a name="direction"></a>QBoxLayout::direction () const</h3><p> Returns the direction of the box. <a href="#addWidget">addWidget</a>() and <a href="#addSpacing">addSpacing</a>()work in this direction; the stretch stretches in this direction.<p> <p>See also <a href="#Direction-enum">QBoxLayout::Direction</a>, <a href="#addWidget">addWidget</a>() and <a href="#addSpacing">addSpacing</a>().<h3 class=fn><a href="qsizepolicy.html#ExpandData-enum">QSizePolicy::ExpandData</a> <a name="expanding"></a>QBoxLayout::expanding () const<tt> [virtual]</tt></h3>Returns the expansiveness of this layout.<p>Reimplemented from <a href="qlayout.html#expanding">QLayout</a>.<h3 class=fn>int <a name="findWidget"></a>QBoxLayout::findWidget ( <a href="qwidget.html">QWidget</a> * w )</h3>Searches for widget <em>w</em> in this layout (not including childlayouts).<p> Returns the index of <em>w</em>, or -1 if <em>w</em> is not found.<h3 class=fn>bool <a name="hasHeightForWidth"></a>QBoxLayout::hasHeightForWidth () const<tt> [virtual]</tt></h3>Returns TRUE if this layout's preferred height depends on its width;otherwise returns FALSE.<p>Reimplemented from <a href="qlayoutitem.html#hasHeightForWidth">QLayoutItem</a>.<h3 class=fn>int <a name="heightForWidth"></a>QBoxLayout::heightForWidth ( int w ) const<tt> [virtual]</tt></h3>Returns the layout's preferred height when it is <em>w</em> pixels wide.<p>Reimplemented from <a href="qlayoutitem.html#heightForWidth">QLayoutItem</a>.<h3 class=fn>void <a name="insertItem"></a>QBoxLayout::insertItem ( int index, <a href="qlayoutitem.html">QLayoutItem</a> * item )<tt> [protected]</tt></h3>Inserts <em>item</em> into this box layout at position <em>index</em>. If <em>index</em> is negative, the item is added at the end.<p> <b>Warning:</b> Does not call QLayout::insertChildLayout() if <em>item</em> isa <a href="qlayout.html">QLayout</a>.<p> <p>See also <a href="#addItem">addItem</a>() and <a href="#findWidget">findWidget</a>().<h3 class=fn>void <a name="insertLayout"></a>QBoxLayout::insertLayout ( int index, <a href="qlayout.html">QLayout</a> * layout, int stretch = 0 )</h3>Inserts <em>layout</em> at position <em>index</em>, with <a href="layout.html#stretch-factor">stretch factor</a> <em>stretch</em>. If <em>index</em> is negative, the layout is added at the end.<p> <p>See also <a href="qlayout.html#setAutoAdd">setAutoAdd</a>(), <a href="#insertWidget">insertWidget</a>() and <a href="#insertSpacing">insertSpacing</a>().<h3 class=fn>void <a name="insertSpacing"></a>QBoxLayout::insertSpacing ( int index, int size )</h3>Inserts a non-stretchable space at position <em>index</em>, with size <em>size</em>. If <em>index</em> is negative the space is added at the end.<p> The box layout has default margin and spacing. This function addsadditional space.<p> <p>See also <a href="#insertStretch">insertStretch</a>().<h3 class=fn>void <a name="insertStretch"></a>QBoxLayout::insertStretch ( int index, int stretch = 0 )</h3>Inserts a stretchable space at position <em>index</em>, with zerominimum size and <a href="layout.html#stretch-factor">stretch factor</a> <em>stretch</em>. If <em>index</em> isnegative the space is added at the end.<p> <p>See also <a href="#insertSpacing">insertSpacing</a>().<h3 class=fn>void <a name="insertWidget"></a>QBoxLayout::insertWidget ( int index, <a href="qwidget.html">QWidget</a> * widget, int stretch = 0, int alignment = 0 )</h3>Inserts <em>widget</em> at position <em>index</em>, with <a href="layout.html#stretch-factor">stretch factor</a> <em>stretch</em> and alignment <em>alignment</em>. If <em>index</em> is negative, thewidget is added at the end.<p> The stretch factor applies only in the <a href="#direction">direction</a> of the QBoxLayout, and is relative to the other boxes andwidgets in this QBoxLayout. Widgets and boxes with higher stretchfactors grow more.<p> If the stretch factor is 0 and nothing else in the QBoxLayout hasa stretch factor greater than zero, the space is distributedaccording to the QWidget:sizePolicy() of each widget that'sinvolved.<p> Alignment is specified by <em>alignment</em>, which is a bitwise OR of<a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a> values. The default alignment is 0, whichmeans that the widget fills the entire cell.<p> From Qt 3.0, the <em>alignment</em> parameter is interpreted moreaggressively than in previous versions of Qt. A non-defaultalignment now indicates that the widget should not grow to fillthe available space, but should be sized according to <a href="#sizeHint">sizeHint</a>().<p> <p>See also <a href="qlayout.html#setAutoAdd">setAutoAdd</a>(), <a href="#insertLayout">insertLayout</a>() and <a href="#insertSpacing">insertSpacing</a>().<h3 class=fn>void <a name="invalidate"></a>QBoxLayout::invalidate ()<tt> [virtual]</tt></h3>Resets cached information.<p>Reimplemented from <a href="qlayout.html#invalidate">QLayout</a>.<h3 class=fn><a href="qsize.html">QSize</a> <a name="maximumSize"></a>QBoxLayout::maximumSize () const<tt> [virtual]</tt></h3>Returns the maximum size needed by this box layout.<p>Reimplemented from <a href="qlayout.html#maximumSize">QLayout</a>.<h3 class=fn><a href="qsize.html">QSize</a> <a name="minimumSize"></a>QBoxLayout::minimumSize () const<tt> [virtual]</tt></h3>Returns the minimum size needed by this box layout.<p>Reimplemented from <a href="qlayout.html#minimumSize">QLayout</a>.<h3 class=fn>void <a name="setDirection"></a>QBoxLayout::setDirection ( <a href="qboxlayout.html#Direction-enum">Direction</a> direction )</h3>Sets the direction of this layout to <em>direction</em>.<h3 class=fn>void <a name="setGeometry"></a>QBoxLayout::setGeometry ( const <a href="qrect.html">QRect</a> & r )<tt> [virtual]</tt></h3>Resizes managed widgets within the rectangle <em>r</em>.<p>Reimplemented from <a href="qlayout.html#setGeometry">QLayout</a>.<h3 class=fn>bool <a name="setStretchFactor"></a>QBoxLayout::setStretchFactor ( <a href="qwidget.html">QWidget</a> * w, int stretch )</h3>Sets the <a href="layout.html#stretch-factor">stretch factor</a> for widget <em>w</em> to <em>stretch</em> and returnsTRUE if <em>w</em> is found in this layout (not including childlayouts); otherwise returns FALSE.<h3 class=fn>bool <a name="setStretchFactor-2"></a>QBoxLayout::setStretchFactor ( <a href="qlayout.html">QLayout</a> * l, int stretch )</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Sets the <a href="layout.html#stretch-factor">stretch factor</a> for the layout <em>l</em> to <em>stretch</em> andreturns TRUE if <em>l</em> is found in this layout (not including childlayouts); otherwise returns FALSE.<h3 class=fn><a href="qsize.html">QSize</a> <a name="sizeHint"></a>QBoxLayout::sizeHint () const<tt> [virtual]</tt></h3>Returns the preferred size of this box layout.<p>Reimplemented from <a href="qlayoutitem.html#sizeHint">QLayoutItem</a>.<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright © 1995-2002<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright © 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -