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

📄 qlayout.html

📁 QT 下载资料仅供参考
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<p> Note that a top-level layout is not necessarily associated withthe top-level widget.<p> <p>See also <a href="#setAutoAdd">setAutoAdd</a>().<h3 class=fn>void <a name="deleteAllItems"></a>QLayout::deleteAllItems ()<tt> [protected]</tt></h3>Removes and deletes all items in this layout.<h3 class=fn><a href="qsizepolicy.html#ExpandData-enum">QSizePolicy::ExpandData</a> <a name="expanding"></a>QLayout::expanding () const<tt> [virtual]</tt></h3>Returns whether this layout can make use of more space than<a href="qlayoutitem.html#sizeHint">sizeHint</a>(). A value of Vertical or Horizontal means that it wantsto grow in only one dimension, whereas BothDirections means thatit wants to grow in both dimensions.<p> The default implementation returns BothDirections.<p>Examples: <a href="customlayout-example.html#x1362">customlayout/border.cpp</a> and <a href="customlayout-example.html#x1339">customlayout/flow.cpp</a>.<p>Reimplemented from <a href="qlayoutitem.html#expanding">QLayoutItem</a>.<p>Reimplemented in <a href="qgridlayout.html#expanding">QGridLayout</a> and <a href="qboxlayout.html#expanding">QBoxLayout</a>.<h3 class=fn>void <a name="invalidate"></a>QLayout::invalidate ()<tt> [virtual]</tt></h3>Invalidates cached information. Reimplementations must call this.<p>Reimplemented from <a href="qlayoutitem.html#invalidate">QLayoutItem</a>.<p>Reimplemented in <a href="qgridlayout.html#invalidate">QGridLayout</a> and <a href="qboxlayout.html#invalidate">QBoxLayout</a>.<h3 class=fn>bool <a name="isEmpty"></a>QLayout::isEmpty () const<tt> [virtual]</tt></h3>Returns TRUE if this layout is empty. The default implementationreturns FALSE.<p>Reimplemented from <a href="qlayoutitem.html#isEmpty">QLayoutItem</a>.<h3 class=fn>bool <a name="isEnabled"></a>QLayout::isEnabled () const</h3>Returns TRUE if the layout is enabled; otherwise returns FALSE.<p> <p>See also <a href="#setEnabled">setEnabled</a>().<h3 class=fn>bool <a name="isTopLevel"></a>QLayout::isTopLevel () const</h3><p> Returns TRUE if this layout is a top-level layout, i.e. not achild of another layout; otherwise returns FALSE.<h3 class=fn><a href="qlayoutiterator.html">QLayoutIterator</a> <a name="iterator"></a>QLayout::iterator ()<tt> [pure virtual]</tt></h3><p> Implemented in subclasses to return an iterator that iterates overthis layout's children.<p> A typical implementation will be:<pre>        QLayoutIterator MyLayout::iterator()        {            <a href="qglayoutiterator.html">QGLayoutIterator</a> *i = new MyLayoutIterator( internal_data );            return QLayoutIterator( i );        }    </pre> where MyLayoutIterator is a subclass of <a href="qglayoutiterator.html">QGLayoutIterator</a>.<p>Examples: <a href="customlayout-example.html#x1363">customlayout/border.cpp</a>, <a href="customlayout-example.html#x1383">customlayout/card.cpp</a> and <a href="customlayout-example.html#x1340">customlayout/flow.cpp</a>.<p>Reimplemented from <a href="qlayoutitem.html#iterator">QLayoutItem</a>.<h3 class=fn><a href="qwidget.html">QWidget</a>&nbsp;* <a name="mainWidget"></a>QLayout::mainWidget ()</h3>Returns the main widget (parent widget) of this layout, or 0 ifthis layout is a sub-layout that is not yet inserted.<h3 class=fn>int <a name="margin"></a>QLayout::margin () const</h3><p>Returns the width of the outside border of the layout.See the <a href="qlayout.html#margin-prop">"margin"</a> property for details.<h3 class=fn><a href="qsize.html">QSize</a> <a name="maximumSize"></a>QLayout::maximumSize () const<tt> [virtual]</tt></h3>Returns the maximum size of this layout. This is the largest sizethat the layout can have while still respecting thespecifications. Does not include what's needed by <a href="#margin">margin</a>() or<a href="#menuBar">menuBar</a>().<p> The default implementation allows unlimited resizing.<p>Reimplemented from <a href="qlayoutitem.html#maximumSize">QLayoutItem</a>.<p>Reimplemented in <a href="qgridlayout.html#maximumSize">QGridLayout</a> and <a href="qboxlayout.html#maximumSize">QBoxLayout</a>.<h3 class=fn><a href="qmenubar.html">QMenuBar</a>&nbsp;* <a name="menuBar"></a>QLayout::menuBar () const</h3><p> Returns the menu bar set for this layout, or 0 if no menu bar isset.<h3 class=fn><a href="qsize.html">QSize</a> <a name="minimumSize"></a>QLayout::minimumSize () const<tt> [virtual]</tt></h3>Returns the minimum size of this layout. This is the smallest sizethat the layout can have while still respecting thespecifications. Does not include what's needed by <a href="#margin">margin</a>() or<a href="#menuBar">menuBar</a>().<p> The default implementation allows unlimited resizing.<p>Examples: <a href="customlayout-example.html#x1364">customlayout/border.cpp</a>, <a href="customlayout-example.html#x1384">customlayout/card.cpp</a> and <a href="customlayout-example.html#x1341">customlayout/flow.cpp</a>.<p>Reimplemented from <a href="qlayoutitem.html#minimumSize">QLayoutItem</a>.<p>Reimplemented in <a href="qgridlayout.html#minimumSize">QGridLayout</a> and <a href="qboxlayout.html#minimumSize">QBoxLayout</a>.<h3 class=fn><a href="qlayout.html#ResizeMode-enum">ResizeMode</a> <a name="resizeMode"></a>QLayout::resizeMode () const</h3><p>Returns the resize mode of the layout.See the <a href="qlayout.html#resizeMode-prop">"resizeMode"</a> property for details.<h3 class=fn>void <a name="setAutoAdd"></a>QLayout::setAutoAdd ( bool&nbsp;b )<tt> [virtual]</tt></h3>If <em>b</em> is TRUE, auto-add is enabled; otherwise auto-add isdisabled.<p> <p>See also <a href="#autoAdd">autoAdd</a>().<p>Example: <a href="i18n-example.html#x1927">i18n/main.cpp</a>.<h3 class=fn>void <a name="setEnabled"></a>QLayout::setEnabled ( bool&nbsp;enable )</h3>Enables this layout if <em>enable</em> is TRUE, otherwise disables it.<p> An enabled layout adjusts dynamically to changes; a disabledlayout acts as if it did not exist.<p> By default all layouts are enabled.<p> <p>See also <a href="#isEnabled">isEnabled</a>().<h3 class=fn>void <a name="setGeometry"></a>QLayout::setGeometry ( const&nbsp;<a href="qrect.html">QRect</a>&nbsp;&amp;&nbsp;r )<tt> [pure virtual]</tt></h3>This function is reimplemented in subclasses to perform layout.<p> The default implementation maintains the <a href="qlayoutitem.html#geometry">geometry</a>() informationgiven by rect <em>r</em>. Reimplementors must call this function.<p>Examples: <a href="customlayout-example.html#x1365">customlayout/border.cpp</a>, <a href="customlayout-example.html#x1385">customlayout/card.cpp</a> and <a href="customlayout-example.html#x1342">customlayout/flow.cpp</a>.<p>Reimplemented from <a href="qlayoutitem.html#setGeometry">QLayoutItem</a>.<p>Reimplemented in <a href="qgridlayout.html#setGeometry">QGridLayout</a> and <a href="qboxlayout.html#setGeometry">QBoxLayout</a>.<h3 class=fn>void <a name="setMargin"></a>QLayout::setMargin ( int )<tt> [virtual]</tt></h3><p>Sets the width of the outside border of the layout.See the <a href="qlayout.html#margin-prop">"margin"</a> property for details.<h3 class=fn>void <a name="setMenuBar"></a>QLayout::setMenuBar ( <a href="qmenubar.html">QMenuBar</a>&nbsp;*&nbsp;w )<tt> [virtual]</tt></h3>Makes the geometry manager take account of the menu bar <em>w</em>. Allchild widgets are placed below the bottom edge of the menu bar.<p> A menu bar does its own geometry management: never do addWidget()on a <a href="qmenubar.html">QMenuBar</a>.<p>Examples: <a href="layout-example.html#x490">layout/layout.cpp</a> and <a href="scrollview-example.html#x718">scrollview/scrollview.cpp</a>.<h3 class=fn>void <a name="setResizeMode"></a>QLayout::setResizeMode ( <a href="qlayout.html#ResizeMode-enum">ResizeMode</a> )</h3><p>Sets the resize mode of the layout.See the <a href="qlayout.html#resizeMode-prop">"resizeMode"</a> property for details.<h3 class=fn>void <a name="setSpacing"></a>QLayout::setSpacing ( int )<tt> [virtual]</tt></h3><p>Sets the spacing between widgets inside the layout.See the <a href="qlayout.html#spacing-prop">"spacing"</a> property for details.<h3 class=fn>void <a name="setSupportsMargin"></a>QLayout::setSupportsMargin ( bool&nbsp;b )<tt> [protected]</tt></h3>Sets the value returned by <a href="#supportsMargin">supportsMargin</a>(). If <em>b</em> is TRUE,<a href="#margin">margin</a>() handling is implemented by the subclass. If <em>b</em> isFALSE (the default), QLayout will add margin() around top-levellayouts.<p> If <em>b</em> is TRUE, margin handling needs to be implemented in<a href="#setGeometry">setGeometry</a>(), <a href="#maximumSize">maximumSize</a>(), <a href="#minimumSize">minimumSize</a>(), <a href="qlayoutitem.html#sizeHint">sizeHint</a>() and<a href="qlayoutitem.html#heightForWidth">heightForWidth</a>().<p> <p>See also <a href="#supportsMargin">supportsMargin</a>().<h3 class=fn>int <a name="spacing"></a>QLayout::spacing () const</h3><p>Returns the spacing between widgets inside the layout.See the <a href="qlayout.html#spacing-prop">"spacing"</a> property for details.<h3 class=fn>bool <a name="supportsMargin"></a>QLayout::supportsMargin () const</h3><p> Returns TRUE if this layout supports <a href="#margin-prop">QLayout::margin</a> onnon-top-level layouts; otherwise returns FALSE.<p> <p>See also <a href="#margin-prop">margin</a>.<hr><h2>Property Documentation</h2><h3 class=fn>int <a name="margin-prop"></a>margin</h3><p>This property holds the width of the outside border of the layout.<p>For some layout classes this property has an effect only ontop-level layouts; <a href="qboxlayout.html">QBoxLayout</a> and <a href="qgridlayout.html">QGridLayout</a> support margins forchild layouts. The default value is 0.<p> <p>See also <a href="#spacing-prop">spacing</a>.<p>Set this property's value with <a href="#setMargin">setMargin</a>() and get this property's value with <a href="#margin">margin</a>().<h3 class=fn><a href="qlayout.html#ResizeMode-enum">ResizeMode</a> <a name="resizeMode-prop"></a>resizeMode</h3><p>This property holds the resize mode of the layout.<p>The default mode is <a href="#ResizeMode-enum">Minimum</a> for top-level widgets and <a href="#ResizeMode-enum">FreeResize</a> for all others.<p> <p>See also <a href="#ResizeMode-enum">QLayout::ResizeMode</a>.<p>Set this property's value with <a href="#setResizeMode">setResizeMode</a>() and get this property's value with <a href="#resizeMode">resizeMode</a>().<h3 class=fn>int <a name="spacing-prop"></a>spacing</h3><p>This property holds the spacing between widgets inside the layout.<p>The default value is -1, which signifies that the layout's spacingshould not override the widget's spacing.<p> <p>See also <a href="#margin-prop">margin</a>.<p>Set this property's value with <a href="#setSpacing">setSpacing</a>() and get this property's value with <a href="#spacing">spacing</a>().<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright &copy; 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 &copy; 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 + -