Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 753454bfb193d7e8ae714a765a56bb39 > files > 3680

qtbase5-doc-5.12.6-1.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qboxlayout.cpp -->
  <title>QBoxLayout Class | Qt Widgets 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QBoxLayout</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtwidgets-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QBoxLayout Class</h1>
<!-- $$$QBoxLayout-brief -->
<p>The <a href="qboxlayout.html">QBoxLayout</a> class lines up child widgets horizontally or vertically. <a href="#details">More...</a></p>
<!-- @@@QBoxLayout -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QBoxLayout&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qlayout.html">QLayout</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qhboxlayout.html">QHBoxLayout</a> and <a href="qvboxlayout.html">QVBoxLayout</a></p>
</td></tr></table></div><ul>
<li><a href="qboxlayout-members.html">List of all members, including inherited members</a></li>
<li><a href="qboxlayout-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#Direction-enum">Direction</a></b> { LeftToRight, RightToLeft, TopToBottom, BottomToTop }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#QBoxLayout">QBoxLayout</a></b>(QBoxLayout::Direction <i>dir</i>, QWidget *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#dtor.QBoxLayout">~QBoxLayout</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#addLayout">addLayout</a></b>(QLayout *<i>layout</i>, int <i>stretch</i> = 0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#addSpacerItem">addSpacerItem</a></b>(QSpacerItem *<i>spacerItem</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#addSpacing">addSpacing</a></b>(int <i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#addStretch">addStretch</a></b>(int <i>stretch</i> = 0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#addStrut">addStrut</a></b>(int <i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#addWidget">addWidget</a></b>(QWidget *<i>widget</i>, int <i>stretch</i> = 0, Qt::Alignment <i>alignment</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QBoxLayout::Direction </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#direction">direction</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#insertItem">insertItem</a></b>(int <i>index</i>, QLayoutItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#insertLayout">insertLayout</a></b>(int <i>index</i>, QLayout *<i>layout</i>, int <i>stretch</i> = 0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#insertSpacerItem">insertSpacerItem</a></b>(int <i>index</i>, QSpacerItem *<i>spacerItem</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#insertSpacing">insertSpacing</a></b>(int <i>index</i>, int <i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#insertStretch">insertStretch</a></b>(int <i>index</i>, int <i>stretch</i> = 0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#insertWidget">insertWidget</a></b>(int <i>index</i>, QWidget *<i>widget</i>, int <i>stretch</i> = 0, Qt::Alignment <i>alignment</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#setDirection">setDirection</a></b>(QBoxLayout::Direction <i>direction</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#setSpacing">setSpacing</a></b>(int <i>spacing</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#setStretch">setStretch</a></b>(int <i>index</i>, int <i>stretch</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#setStretchFactor">setStretchFactor</a></b>(QWidget *<i>widget</i>, int <i>stretch</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#setStretchFactor-1">setStretchFactor</a></b>(QLayout *<i>layout</i>, int <i>stretch</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#spacing">spacing</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#stretch">stretch</a></b>(int <i>index</i>) const</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#addItem">addItem</a></b>(QLayoutItem *<i>item</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#count">count</a></b>() const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual Qt::Orientations </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#expandingDirections">expandingDirections</a></b>() const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#hasHeightForWidth">hasHeightForWidth</a></b>() const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#heightForWidth">heightForWidth</a></b>(int <i>w</i>) const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#invalidate">invalidate</a></b>() override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QLayoutItem *</td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#itemAt">itemAt</a></b>(int <i>index</i>) const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#maximumSize">maximumSize</a></b>() const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#minimumHeightForWidth">minimumHeightForWidth</a></b>(int <i>w</i>) const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#minimumSize">minimumSize</a></b>() const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#setGeometry">setGeometry</a></b>(const QRect &amp;<i>r</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#sizeHint">sizeHint</a></b>() const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QLayoutItem *</td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#takeAt">takeAt</a></b>(int <i>index</i>) override</td></tr>
</table></div>
<ul>
<li class="fn">37 public functions inherited from <a href="qlayout.html#public-functions">QLayout</a></li>
<li class="fn">31 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
<li class="fn">17 public functions inherited from <a href="qlayoutitem.html#public-functions">QLayoutItem</a></li>
</ul>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qboxlayout.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<ul>
<li class="fn">1 static public member inherited from <a href="qlayout.html#static-public-members">QLayout</a></li>
<li class="fn">9 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">2 properties inherited from <a href="qlayout.html#properties">QLayout</a></li>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
<li class="fn">4 protected functions inherited from <a href="qlayout.html#protected-functions">QLayout</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QBoxLayout-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qboxlayout.html">QBoxLayout</a> class lines up child widgets horizontally or vertically.</p>
<p><a href="qboxlayout.html">QBoxLayout</a> takes the space it gets (from its parent layout or from the <a href="qlayout.html#parentWidget">parentWidget</a>()), divides it up into a row of boxes, and makes each managed widget fill one box.</p>
<p class="centerAlign"><img src="images/qhboxlayout-with-5-children.png" alt="Horizontal box layout with five child widgets" /></p><p>If the <a href="qboxlayout.html">QBoxLayout</a>'s orientation is <a href="../qtcore/qt.html#Orientation-enum">Qt::Horizontal</a> 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).</p>
<p class="centerAlign"><img src="images/qvboxlayout-with-5-children.png" alt="Vertical box layout with five child widgets" /></p><p>If the <a href="qboxlayout.html">QBoxLayout</a>'s orientation is <a href="../qtcore/qt.html#Orientation-enum">Qt::Vertical</a>, the boxes are placed in a column, again with suitable sizes.</p>
<p>The easiest way to create a <a href="qboxlayout.html">QBoxLayout</a> is to use one of the convenience classes, e.g&#x2e; <a href="qhboxlayout.html">QHBoxLayout</a> (for <a href="../qtcore/qt.html#Orientation-enum">Qt::Horizontal</a> boxes) or <a href="qvboxlayout.html">QVBoxLayout</a> (for <a href="../qtcore/qt.html#Orientation-enum">Qt::Vertical</a> boxes). You can also use the <a href="qboxlayout.html">QBoxLayout</a> constructor directly, specifying its direction as <a href="qboxlayout.html#Direction-enum">LeftToRight</a>, <a href="qboxlayout.html#Direction-enum">RightToLeft</a>, <a href="qboxlayout.html#Direction-enum">TopToBottom</a>, or <a href="qboxlayout.html#Direction-enum">BottomToTop</a>.</p>
<p>If the <a href="qboxlayout.html">QBoxLayout</a> is not the top-level layout (i.e&#x2e; 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-&gt;<a href="qboxlayout.html#addLayout">addLayout</a>().</p>
<p>Once you have done this, you can add boxes to the <a href="qboxlayout.html">QBoxLayout</a> using one of four functions:</p>
<ul>
<li><a href="qboxlayout.html#addWidget">addWidget</a>() to add a widget to the <a href="qboxlayout.html">QBoxLayout</a> and set the widget's stretch factor. (The stretch factor is along the row of boxes.)</li>
<li><a href="qboxlayout.html#addSpacing">addSpacing</a>() 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.</li>
<li><a href="qboxlayout.html#addStretch">addStretch</a>() to create an empty, stretchable box.</li>
<li><a href="qboxlayout.html#addLayout">addLayout</a>() to add a box containing another <a href="qlayout.html">QLayout</a> to the row and set that layout's stretch factor.</li>
</ul>
<p>Use <a href="qboxlayout.html#insertWidget">insertWidget</a>(), <a href="qboxlayout.html#insertSpacing">insertSpacing</a>(), <a href="qboxlayout.html#insertStretch">insertStretch</a>() or <a href="qboxlayout.html#insertLayout">insertLayout</a>() to insert a box at a specified position in the layout.</p>
<p><a href="qboxlayout.html">QBoxLayout</a> also includes two margin widths:</p>
<ul>
<li><a href="qlayout.html#setContentsMargins">setContentsMargins</a>() sets the width of the outer border on each side of the widget. This is the width of the reserved space along each of the <a href="qboxlayout.html">QBoxLayout</a>'s four sides.</li>
<li><a href="qboxlayout.html#setSpacing">setSpacing</a>() sets the width between neighboring boxes. (You can use <a href="qboxlayout.html#addSpacing">addSpacing</a>() to get more space at a particular spot.)</li>
</ul>
<p>The margin default is provided by the style. The default margin most Qt styles specify is 9 for child widgets and 11 for windows. The spacing defaults to the same as the margin width for a top-level layout, or to the same as the parent layout.</p>
<p>To remove a widget from a layout, call <a href="qlayout.html#removeWidget">removeWidget</a>(). Calling <a href="qwidget.html#hide">QWidget::hide</a>() on a widget also effectively removes the widget from the layout until <a href="qwidget.html#show">QWidget::show</a>() is called.</p>
<p>You will almost always want to use <a href="qvboxlayout.html">QVBoxLayout</a> and <a href="qhboxlayout.html">QHBoxLayout</a> rather than <a href="qboxlayout.html">QBoxLayout</a> because of their convenient constructors.</p>
</div>
<p><b>See also </b><a href="qgridlayout.html">QGridLayout</a>, <a href="qstackedlayout.html">QStackedLayout</a>, and <a href="layout.html">Layout Management</a>.</p>
<!-- @@@QBoxLayout -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Direction$$$LeftToRight$$$RightToLeft$$$TopToBottom$$$BottomToTop$$$Down$$$Up -->
<h3 class="fn" id="Direction-enum"><a name="Direction-enum"></a>enum QBoxLayout::<span class="name">Direction</span></h3>
<p>This type is used to determine the direction of a box layout.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QBoxLayout::LeftToRight</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Horizontal from left to right.</td></tr>
<tr><td class="topAlign"><code>QBoxLayout::RightToLeft</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Horizontal from right to left.</td></tr>
<tr><td class="topAlign"><code>QBoxLayout::TopToBottom</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">Vertical from top to bottom.</td></tr>
<tr><td class="topAlign"><code>QBoxLayout::BottomToTop</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">Vertical from bottom to top.</td></tr>
</table></div>
<!-- @@@Direction -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QBoxLayout[overload1]$$$QBoxLayoutQBoxLayout::DirectionQWidget* -->
<h3 class="fn" id="QBoxLayout"><a name="QBoxLayout"></a>QBoxLayout::<span class="name">QBoxLayout</span>(<span class="type"><a href="qboxlayout.html#Direction-enum">QBoxLayout::Direction</a></span> <i>dir</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs a new <a href="qboxlayout.html">QBoxLayout</a> with direction <i>dir</i> and parent widget <i>parent</i>.</p>
<p><b>See also </b><a href="qboxlayout.html#direction">direction</a>().</p>
<!-- @@@QBoxLayout -->
<!-- $$$~QBoxLayout[overload1]$$$~QBoxLayout -->
<h3 class="fn" id="dtor.QBoxLayout"><a name="dtor.QBoxLayout"></a><code>[virtual] </code>QBoxLayout::<span class="name">~QBoxLayout</span>()</h3>
<p>Destroys this box layout.</p>
<p>The layout's widgets aren't destroyed.</p>
<!-- @@@~QBoxLayout -->
<!-- $$$addItem[overload1]$$$addItemQLayoutItem* -->
<h3 class="fn" id="addItem"><a name="addItem"></a><code>[override virtual] </code><span class="type">void</span> QBoxLayout::<span class="name">addItem</span>(<span class="type"><a href="qlayoutitem.html#QLayoutItem">QLayoutItem</a></span> *<i>item</i>)</h3>
<p>Reimplemented from <a href="qlayout.html#addItem">QLayout::addItem</a>().</p>
<!-- @@@addItem -->
<!-- $$$addLayout[overload1]$$$addLayoutQLayout*int -->
<h3 class="fn" id="addLayout"><a name="addLayout"></a><span class="type">void</span> QBoxLayout::<span class="name">addLayout</span>(<span class="type"><a href="qlayout.html#QLayout">QLayout</a></span> *<i>layout</i>, <span class="type">int</span> <i>stretch</i> = 0)</h3>
<p>Adds <i>layout</i> to the end of the box, with serial stretch factor <i>stretch</i>.</p>
<p><b>See also </b><a href="qboxlayout.html#insertLayout">insertLayout</a>(), <a href="qboxlayout.html#addItem">addItem</a>(), and <a href="qboxlayout.html#addWidget">addWidget</a>().</p>
<!-- @@@addLayout -->
<!-- $$$addSpacerItem[overload1]$$$addSpacerItemQSpacerItem* -->
<h3 class="fn" id="addSpacerItem"><a name="addSpacerItem"></a><span class="type">void</span> QBoxLayout::<span class="name">addSpacerItem</span>(<span class="type"><a href="qspaceritem.html">QSpacerItem</a></span> *<i>spacerItem</i>)</h3>
<p>Adds <i>spacerItem</i> to the end of this box layout.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qboxlayout.html#addSpacing">addSpacing</a>() and <a href="qboxlayout.html#addStretch">addStretch</a>().</p>
<!-- @@@addSpacerItem -->
<!-- $$$addSpacing[overload1]$$$addSpacingint -->
<h3 class="fn" id="addSpacing"><a name="addSpacing"></a><span class="type">void</span> QBoxLayout::<span class="name">addSpacing</span>(<span class="type">int</span> <i>size</i>)</h3>
<p>Adds a non-stretchable space (a <a href="qspaceritem.html">QSpacerItem</a>) with size <i>size</i> to the end of this box layout. <a href="qboxlayout.html">QBoxLayout</a> provides default margin and spacing. This function adds additional space.</p>
<p><b>See also </b><a href="qboxlayout.html#insertSpacing">insertSpacing</a>(), <a href="qboxlayout.html#addItem">addItem</a>(), and <a href="qspaceritem.html">QSpacerItem</a>.</p>
<!-- @@@addSpacing -->
<!-- $$$addStretch[overload1]$$$addStretchint -->
<h3 class="fn" id="addStretch"><a name="addStretch"></a><span class="type">void</span> QBoxLayout::<span class="name">addStretch</span>(<span class="type">int</span> <i>stretch</i> = 0)</h3>
<p>Adds a stretchable space (a <a href="qspaceritem.html">QSpacerItem</a>) with zero minimum size and stretch factor <i>stretch</i> to the end of this box layout.</p>
<p><b>See also </b><a href="qboxlayout.html#insertStretch">insertStretch</a>(), <a href="qboxlayout.html#addItem">addItem</a>(), and <a href="qspaceritem.html">QSpacerItem</a>.</p>
<!-- @@@addStretch -->
<!-- $$$addStrut[overload1]$$$addStrutint -->
<h3 class="fn" id="addStrut"><a name="addStrut"></a><span class="type">void</span> QBoxLayout::<span class="name">addStrut</span>(<span class="type">int</span> <i>size</i>)</h3>
<p>Limits the perpendicular dimension of the box (e.g&#x2e; height if the box is <a href="qboxlayout.html#Direction-enum">LeftToRight</a>) to a minimum of <i>size</i>. Other constraints may increase the limit.</p>
<p><b>See also </b><a href="qboxlayout.html#addItem">addItem</a>().</p>
<!-- @@@addStrut -->
<!-- $$$addWidget[overload1]$$$addWidgetQWidget*intQt::Alignment -->
<h3 class="fn" id="addWidget"><a name="addWidget"></a><span class="type">void</span> QBoxLayout::<span class="name">addWidget</span>(<span class="type"><a href="qwidget.html">QWidget</a></span> *<i>widget</i>, <span class="type">int</span> <i>stretch</i> = 0, <span class="type"><a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> <i>alignment</i> = ...)</h3>
<p>Adds <i>widget</i> to the end of this box layout, with a stretch factor of <i>stretch</i> and alignment <i>alignment</i>.</p>
<p>The stretch factor applies only in the <a href="qboxlayout.html#direction">direction</a> of the <a href="qboxlayout.html">QBoxLayout</a>, and is relative to the other boxes and widgets in this <a href="qboxlayout.html">QBoxLayout</a>. Widgets and boxes with higher stretch factors grow more.</p>
<p>If the stretch factor is 0 and nothing else in the <a href="qboxlayout.html">QBoxLayout</a> has a stretch factor greater than zero, the space is distributed according to the <a href="qwidget.html">QWidget</a>:sizePolicy() of each widget that's involved.</p>
<p>The alignment is specified by <i>alignment</i>. The default alignment is 0, which means that the widget fills the entire cell.</p>
<p><b>See also </b><a href="qboxlayout.html#insertWidget">insertWidget</a>(), <a href="qboxlayout.html#addItem">addItem</a>(), <a href="qboxlayout.html#addLayout">addLayout</a>(), <a href="qboxlayout.html#addStretch">addStretch</a>(), <a href="qboxlayout.html#addSpacing">addSpacing</a>(), and <a href="qboxlayout.html#addStrut">addStrut</a>().</p>
<!-- @@@addWidget -->
<!-- $$$count[overload1]$$$count -->
<h3 class="fn" id="count"><a name="count"></a><code>[override virtual] </code><span class="type">int</span> QBoxLayout::<span class="name">count</span>() const</h3>
<p>Reimplemented from <a href="qlayout.html#count">QLayout::count</a>().</p>
<!-- @@@count -->
<!-- $$$direction[overload1]$$$direction -->
<h3 class="fn" id="direction"><a name="direction"></a><span class="type"><a href="qboxlayout.html#Direction-enum">QBoxLayout::Direction</a></span> QBoxLayout::<span class="name">direction</span>() const</h3>
<p>Returns the direction of the box. <a href="qboxlayout.html#addWidget">addWidget</a>() and <a href="qboxlayout.html#addSpacing">addSpacing</a>() work in this direction; the stretch stretches in this direction.</p>
<p><b>See also </b><a href="qboxlayout.html#setDirection">setDirection</a>(), <a href="qboxlayout.html#Direction-enum">QBoxLayout::Direction</a>, <a href="qboxlayout.html#addWidget">addWidget</a>(), and <a href="qboxlayout.html#addSpacing">addSpacing</a>().</p>
<!-- @@@direction -->
<!-- $$$expandingDirections[overload1]$$$expandingDirections -->
<h3 class="fn" id="expandingDirections"><a name="expandingDirections"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qt.html#Orientation-enum">Qt::Orientations</a></span> QBoxLayout::<span class="name">expandingDirections</span>() const</h3>
<p>Reimplemented from <a href="qlayout.html#expandingDirections">QLayout::expandingDirections</a>().</p>
<!-- @@@expandingDirections -->
<!-- $$$hasHeightForWidth[overload1]$$$hasHeightForWidth -->
<h3 class="fn" id="hasHeightForWidth"><a name="hasHeightForWidth"></a><code>[override virtual] </code><span class="type">bool</span> QBoxLayout::<span class="name">hasHeightForWidth</span>() const</h3>
<p>Reimplemented from <a href="qlayoutitem.html#hasHeightForWidth">QLayoutItem::hasHeightForWidth</a>().</p>
<!-- @@@hasHeightForWidth -->
<!-- $$$heightForWidth[overload1]$$$heightForWidthint -->
<h3 class="fn" id="heightForWidth"><a name="heightForWidth"></a><code>[override virtual] </code><span class="type">int</span> QBoxLayout::<span class="name">heightForWidth</span>(<span class="type">int</span> <i>w</i>) const</h3>
<p>Reimplemented from <a href="qlayoutitem.html#heightForWidth">QLayoutItem::heightForWidth</a>().</p>
<!-- @@@heightForWidth -->
<!-- $$$insertItem[overload1]$$$insertItemintQLayoutItem* -->
<h3 class="fn" id="insertItem"><a name="insertItem"></a><span class="type">void</span> QBoxLayout::<span class="name">insertItem</span>(<span class="type">int</span> <i>index</i>, <span class="type"><a href="qlayoutitem.html#QLayoutItem">QLayoutItem</a></span> *<i>item</i>)</h3>
<p>Inserts <i>item</i> into this box layout at position <i>index</i>. If <i>index</i> is negative, the item is added at the end.</p>
<p><b>See also </b><a href="qboxlayout.html#addItem">addItem</a>(), <a href="qboxlayout.html#insertWidget">insertWidget</a>(), <a href="qboxlayout.html#insertLayout">insertLayout</a>(), <a href="qboxlayout.html#insertStretch">insertStretch</a>(), and <a href="qboxlayout.html#insertSpacing">insertSpacing</a>().</p>
<!-- @@@insertItem -->
<!-- $$$insertLayout[overload1]$$$insertLayoutintQLayout*int -->
<h3 class="fn" id="insertLayout"><a name="insertLayout"></a><span class="type">void</span> QBoxLayout::<span class="name">insertLayout</span>(<span class="type">int</span> <i>index</i>, <span class="type"><a href="qlayout.html#QLayout">QLayout</a></span> *<i>layout</i>, <span class="type">int</span> <i>stretch</i> = 0)</h3>
<p>Inserts <i>layout</i> at position <i>index</i>, with stretch factor <i>stretch</i>. If <i>index</i> is negative, the layout is added at the end.</p>
<p><i>layout</i> becomes a child of the box layout.</p>
<p><b>See also </b><a href="qboxlayout.html#addLayout">addLayout</a>() and <a href="qboxlayout.html#insertItem">insertItem</a>().</p>
<!-- @@@insertLayout -->
<!-- $$$insertSpacerItem[overload1]$$$insertSpacerItemintQSpacerItem* -->
<h3 class="fn" id="insertSpacerItem"><a name="insertSpacerItem"></a><span class="type">void</span> QBoxLayout::<span class="name">insertSpacerItem</span>(<span class="type">int</span> <i>index</i>, <span class="type"><a href="qspaceritem.html">QSpacerItem</a></span> *<i>spacerItem</i>)</h3>
<p>Inserts <i>spacerItem</i> at position <i>index</i>, with zero minimum size and stretch factor. If <i>index</i> is negative the space is added at the end.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qboxlayout.html#addSpacerItem">addSpacerItem</a>(), <a href="qboxlayout.html#insertStretch">insertStretch</a>(), and <a href="qboxlayout.html#insertSpacing">insertSpacing</a>().</p>
<!-- @@@insertSpacerItem -->
<!-- $$$insertSpacing[overload1]$$$insertSpacingintint -->
<h3 class="fn" id="insertSpacing"><a name="insertSpacing"></a><span class="type">void</span> QBoxLayout::<span class="name">insertSpacing</span>(<span class="type">int</span> <i>index</i>, <span class="type">int</span> <i>size</i>)</h3>
<p>Inserts a non-stretchable space (a <a href="qspaceritem.html">QSpacerItem</a>) at position <i>index</i>, with size <i>size</i>. If <i>index</i> is negative the space is added at the end.</p>
<p>The box layout has default margin and spacing. This function adds additional space.</p>
<p><b>See also </b><a href="qboxlayout.html#addSpacing">addSpacing</a>(), <a href="qboxlayout.html#insertItem">insertItem</a>(), and <a href="qspaceritem.html">QSpacerItem</a>.</p>
<!-- @@@insertSpacing -->
<!-- $$$insertStretch[overload1]$$$insertStretchintint -->
<h3 class="fn" id="insertStretch"><a name="insertStretch"></a><span class="type">void</span> QBoxLayout::<span class="name">insertStretch</span>(<span class="type">int</span> <i>index</i>, <span class="type">int</span> <i>stretch</i> = 0)</h3>
<p>Inserts a stretchable space (a <a href="qspaceritem.html">QSpacerItem</a>) at position <i>index</i>, with zero minimum size and stretch factor <i>stretch</i>. If <i>index</i> is negative the space is added at the end.</p>
<p><b>See also </b><a href="qboxlayout.html#addStretch">addStretch</a>(), <a href="qboxlayout.html#insertItem">insertItem</a>(), and <a href="qspaceritem.html">QSpacerItem</a>.</p>
<!-- @@@insertStretch -->
<!-- $$$insertWidget[overload1]$$$insertWidgetintQWidget*intQt::Alignment -->
<h3 class="fn" id="insertWidget"><a name="insertWidget"></a><span class="type">void</span> QBoxLayout::<span class="name">insertWidget</span>(<span class="type">int</span> <i>index</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> *<i>widget</i>, <span class="type">int</span> <i>stretch</i> = 0, <span class="type"><a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> <i>alignment</i> = ...)</h3>
<p>Inserts <i>widget</i> at position <i>index</i>, with stretch factor <i>stretch</i> and alignment <i>alignment</i>. If <i>index</i> is negative, the widget is added at the end.</p>
<p>The stretch factor applies only in the <a href="qboxlayout.html#direction">direction</a> of the <a href="qboxlayout.html">QBoxLayout</a>, and is relative to the other boxes and widgets in this <a href="qboxlayout.html">QBoxLayout</a>. Widgets and boxes with higher stretch factors grow more.</p>
<p>If the stretch factor is 0 and nothing else in the <a href="qboxlayout.html">QBoxLayout</a> has a stretch factor greater than zero, the space is distributed according to the <a href="qwidget.html">QWidget</a>:sizePolicy() of each widget that's involved.</p>
<p>The alignment is specified by <i>alignment</i>. The default alignment is 0, which means that the widget fills the entire cell.</p>
<p><b>See also </b><a href="qboxlayout.html#addWidget">addWidget</a>() and <a href="qboxlayout.html#insertItem">insertItem</a>().</p>
<!-- @@@insertWidget -->
<!-- $$$invalidate[overload1]$$$invalidate -->
<h3 class="fn" id="invalidate"><a name="invalidate"></a><code>[override virtual] </code><span class="type">void</span> QBoxLayout::<span class="name">invalidate</span>()</h3>
<p>Reimplemented from <a href="qlayout.html#invalidate">QLayout::invalidate</a>().</p>
<p>Resets cached information.</p>
<!-- @@@invalidate -->
<!-- $$$itemAt[overload1]$$$itemAtint -->
<h3 class="fn" id="itemAt"><a name="itemAt"></a><code>[override virtual] </code><span class="type"><a href="qlayoutitem.html#QLayoutItem">QLayoutItem</a></span> *QBoxLayout::<span class="name">itemAt</span>(<span class="type">int</span> <i>index</i>) const</h3>
<p>Reimplemented from <a href="qlayout.html#itemAt">QLayout::itemAt</a>().</p>
<!-- @@@itemAt -->
<!-- $$$maximumSize[overload1]$$$maximumSize -->
<h3 class="fn" id="maximumSize"><a name="maximumSize"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QBoxLayout::<span class="name">maximumSize</span>() const</h3>
<p>Reimplemented from <a href="qlayout.html#maximumSize">QLayout::maximumSize</a>().</p>
<!-- @@@maximumSize -->
<!-- $$$minimumHeightForWidth[overload1]$$$minimumHeightForWidthint -->
<h3 class="fn" id="minimumHeightForWidth"><a name="minimumHeightForWidth"></a><code>[override virtual] </code><span class="type">int</span> QBoxLayout::<span class="name">minimumHeightForWidth</span>(<span class="type">int</span> <i>w</i>) const</h3>
<p>Reimplemented from <a href="qlayoutitem.html#minimumHeightForWidth">QLayoutItem::minimumHeightForWidth</a>().</p>
<!-- @@@minimumHeightForWidth -->
<!-- $$$minimumSize[overload1]$$$minimumSize -->
<h3 class="fn" id="minimumSize"><a name="minimumSize"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QBoxLayout::<span class="name">minimumSize</span>() const</h3>
<p>Reimplemented from <a href="qlayout.html#minimumSize">QLayout::minimumSize</a>().</p>
<!-- @@@minimumSize -->
<!-- $$$setDirection[overload1]$$$setDirectionQBoxLayout::Direction -->
<h3 class="fn" id="setDirection"><a name="setDirection"></a><span class="type">void</span> QBoxLayout::<span class="name">setDirection</span>(<span class="type"><a href="qboxlayout.html#Direction-enum">QBoxLayout::Direction</a></span> <i>direction</i>)</h3>
<p>Sets the direction of this layout to <i>direction</i>.</p>
<p><b>See also </b><a href="qboxlayout.html#direction">direction</a>().</p>
<!-- @@@setDirection -->
<!-- $$$setGeometry[overload1]$$$setGeometryconstQRect& -->
<h3 class="fn" id="setGeometry"><a name="setGeometry"></a><code>[override virtual] </code><span class="type">void</span> QBoxLayout::<span class="name">setGeometry</span>(const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>r</i>)</h3>
<p>Reimplemented from <a href="qlayout.html#setGeometry">QLayout::setGeometry</a>().</p>
<!-- @@@setGeometry -->
<!-- $$$setSpacing[overload1]$$$setSpacingint -->
<h3 class="fn" id="setSpacing"><a name="setSpacing"></a><span class="type">void</span> QBoxLayout::<span class="name">setSpacing</span>(<span class="type">int</span> <i>spacing</i>)</h3>
<p>Reimplements <a href="qlayout.html#spacing-prop">QLayout::setSpacing</a>(). Sets the spacing property to <i>spacing</i>.</p>
<p><b>See also </b><a href="qlayout.html#spacing-prop">QLayout::setSpacing</a>() and <a href="qboxlayout.html#spacing">spacing</a>().</p>
<!-- @@@setSpacing -->
<!-- $$$setStretch[overload1]$$$setStretchintint -->
<h3 class="fn" id="setStretch"><a name="setStretch"></a><span class="type">void</span> QBoxLayout::<span class="name">setStretch</span>(<span class="type">int</span> <i>index</i>, <span class="type">int</span> <i>stretch</i>)</h3>
<p>Sets the stretch factor at position <i>index</i>. to <i>stretch</i>.</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qboxlayout.html#stretch">stretch</a>().</p>
<!-- @@@setStretch -->
<!-- $$$setStretchFactor[overload1]$$$setStretchFactorQWidget*int -->
<h3 class="fn" id="setStretchFactor"><a name="setStretchFactor"></a><span class="type">bool</span> QBoxLayout::<span class="name">setStretchFactor</span>(<span class="type"><a href="qwidget.html">QWidget</a></span> *<i>widget</i>, <span class="type">int</span> <i>stretch</i>)</h3>
<p>Sets the stretch factor for <i>widget</i> to <i>stretch</i> and returns true if <i>widget</i> is found in this layout (not including child layouts); otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qlayout.html#setAlignment">setAlignment</a>().</p>
<!-- @@@setStretchFactor -->
<!-- $$$setStretchFactor$$$setStretchFactorQLayout*int -->
<h3 class="fn" id="setStretchFactor-1"><a name="setStretchFactor-1"></a><span class="type">bool</span> QBoxLayout::<span class="name">setStretchFactor</span>(<span class="type"><a href="qlayout.html#QLayout">QLayout</a></span> *<i>layout</i>, <span class="type">int</span> <i>stretch</i>)</h3>
<p>This is an overloaded function.</p>
<p>Sets the stretch factor for the layout <i>layout</i> to <i>stretch</i> and returns <code>true</code> if <i>layout</i> is found in this layout (not including child layouts); otherwise returns <code>false</code>.</p>
<!-- @@@setStretchFactor -->
<!-- $$$sizeHint[overload1]$$$sizeHint -->
<h3 class="fn" id="sizeHint"><a name="sizeHint"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QBoxLayout::<span class="name">sizeHint</span>() const</h3>
<p>Reimplemented from <a href="qlayoutitem.html#sizeHint">QLayoutItem::sizeHint</a>().</p>
<!-- @@@sizeHint -->
<!-- $$$spacing[overload1]$$$spacing -->
<h3 class="fn" id="spacing"><a name="spacing"></a><span class="type">int</span> QBoxLayout::<span class="name">spacing</span>() const</h3>
<p>Reimplements <a href="qlayout.html#spacing-prop">QLayout::spacing</a>(). If the spacing property is valid, that value is returned. Otherwise, a value for the spacing property is computed and returned. Since layout spacing in a widget is style dependent, if the parent is a widget, it queries the style for the (horizontal or vertical) spacing of the layout. Otherwise, the parent is a layout, and it queries the parent layout for the spacing().</p>
<p><b>See also </b><a href="qlayout.html#spacing-prop">QLayout::spacing</a>() and <a href="qboxlayout.html#setSpacing">setSpacing</a>().</p>
<!-- @@@spacing -->
<!-- $$$stretch[overload1]$$$stretchint -->
<h3 class="fn" id="stretch"><a name="stretch"></a><span class="type">int</span> QBoxLayout::<span class="name">stretch</span>(<span class="type">int</span> <i>index</i>) const</h3>
<p>Returns the stretch factor at position <i>index</i>.</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qboxlayout.html#setStretch">setStretch</a>().</p>
<!-- @@@stretch -->
<!-- $$$takeAt[overload1]$$$takeAtint -->
<h3 class="fn" id="takeAt"><a name="takeAt"></a><code>[override virtual] </code><span class="type"><a href="qlayoutitem.html#QLayoutItem">QLayoutItem</a></span> *QBoxLayout::<span class="name">takeAt</span>(<span class="type">int</span> <i>index</i>)</h3>
<p>Reimplemented from <a href="qlayout.html#takeAt">QLayout::takeAt</a>().</p>
<!-- @@@takeAt -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>