Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 3880

qtbase5-doc-5.12.6-2.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" />
<!-- qgridlayout.cpp -->
  <title>QGridLayout 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 >QGridLayout</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="#properties">Properties</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="#reimplemented-protected-functions">Reimplemented Protected Functions</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">QGridLayout Class</h1>
<!-- $$$QGridLayout-brief -->
<p>The <a href="qgridlayout.html">QGridLayout</a> class lays out widgets in a grid. <a href="#details">More...</a></p>
<!-- @@@QGridLayout -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QGridLayout&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></table></div><ul>
<li><a href="qgridlayout-members.html">List of all members, including inherited members</a></li>
<li><a href="qgridlayout-obsolete.html">Obsolete members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><a href="qgridlayout.html#horizontalSpacing-prop">horizontalSpacing</a></b> : int</li>
<li class="fn"><b><a href="qgridlayout.html#verticalSpacing-prop">verticalSpacing</a></b> : int</li>
</ul>
<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>
</ul>
<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="qgridlayout.html#QGridLayout">QGridLayout</a></b>(QWidget *<i>parent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#QGridLayout-1">QGridLayout</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#dtor.QGridLayout">~QGridLayout</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#addItem">addItem</a></b>(QLayoutItem *<i>item</i>, int <i>row</i>, int <i>column</i>, int <i>rowSpan</i> = 1, int <i>columnSpan</i> = 1, Qt::Alignment <i>alignment</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#addLayout">addLayout</a></b>(QLayout *<i>layout</i>, int <i>row</i>, int <i>column</i>, Qt::Alignment <i>alignment</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#addLayout-1">addLayout</a></b>(QLayout *<i>layout</i>, int <i>row</i>, int <i>column</i>, int <i>rowSpan</i>, int <i>columnSpan</i>, Qt::Alignment <i>alignment</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#addWidget">addWidget</a></b>(QWidget *<i>widget</i>, int <i>row</i>, int <i>column</i>, Qt::Alignment <i>alignment</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#addWidget-2">addWidget</a></b>(QWidget *<i>widget</i>, int <i>fromRow</i>, int <i>fromColumn</i>, int <i>rowSpan</i>, int <i>columnSpan</i>, Qt::Alignment <i>alignment</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#cellRect">cellRect</a></b>(int <i>row</i>, int <i>column</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#columnCount">columnCount</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#columnMinimumWidth">columnMinimumWidth</a></b>(int <i>column</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#columnStretch">columnStretch</a></b>(int <i>column</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#getItemPosition">getItemPosition</a></b>(int <i>index</i>, int *<i>row</i>, int *<i>column</i>, int *<i>rowSpan</i>, int *<i>columnSpan</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#horizontalSpacing-prop">horizontalSpacing</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QLayoutItem *</td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#itemAtPosition">itemAtPosition</a></b>(int <i>row</i>, int <i>column</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::Corner </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#originCorner">originCorner</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#rowCount">rowCount</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#rowMinimumHeight">rowMinimumHeight</a></b>(int <i>row</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#rowStretch">rowStretch</a></b>(int <i>row</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#setColumnMinimumWidth">setColumnMinimumWidth</a></b>(int <i>column</i>, int <i>minSize</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#setColumnStretch">setColumnStretch</a></b>(int <i>column</i>, int <i>stretch</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#horizontalSpacing-prop">setHorizontalSpacing</a></b>(int <i>spacing</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#setOriginCorner">setOriginCorner</a></b>(Qt::Corner <i>corner</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#setRowMinimumHeight">setRowMinimumHeight</a></b>(int <i>row</i>, int <i>minSize</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#setRowStretch">setRowStretch</a></b>(int <i>row</i>, int <i>stretch</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.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="qgridlayout.html#verticalSpacing-prop">setVerticalSpacing</a></b>(int <i>spacing</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#spacing">spacing</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#verticalSpacing-prop">verticalSpacing</a></b>() 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 int </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.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="qgridlayout.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="qgridlayout.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="qgridlayout.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="qgridlayout.html#invalidate">invalidate</a></b>() override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QLayoutItem *</td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.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="qgridlayout.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="qgridlayout.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="qgridlayout.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="qgridlayout.html#setGeometry">setGeometry</a></b>(const QRect &amp;<i>rect</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.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="qgridlayout.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="qgridlayout.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>
<a name="reimplemented-protected-functions"></a>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgridlayout.html#addItem-1">addItem</a></b>(QLayoutItem *<i>item</i>) override</td></tr>
</table></div>
<ul>
<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>
<h3>Additional Inherited Members</h3>
<ul>
<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>
<!-- $$$QGridLayout-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qgridlayout.html">QGridLayout</a> class lays out widgets in a grid.</p>
<p><a href="qgridlayout.html">QGridLayout</a> takes the space made available to it (by its parent layout or by the <a href="qlayout.html#parentWidget">parentWidget</a>()), divides it up into rows and columns, and puts each widget it manages into the correct cell.</p>
<p>Columns and rows behave identically; we will discuss columns, but there are equivalent functions for rows.</p>
<p>Each column has a minimum width and a stretch factor. The minimum width is the greatest of that set using <a href="qgridlayout.html#setColumnMinimumWidth">setColumnMinimumWidth</a>() and the minimum width of each widget in that column. The stretch factor is set using <a href="qgridlayout.html#setColumnStretch">setColumnStretch</a>() and determines how much of the available space the column will get over and above its necessary minimum.</p>
<p>Normally, each managed widget or layout is put into a cell of its own using <a href="qgridlayout.html#addWidget">addWidget</a>(). It is also possible for a widget to occupy multiple cells using the row and column spanning overloads of <a href="qgridlayout.html#addItem">addItem</a>() and <a href="qgridlayout.html#addWidget">addWidget</a>(). If you do this, <a href="qgridlayout.html">QGridLayout</a> will guess how to distribute the size over the columns/rows (based on the stretch factors).</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>This illustration shows a fragment of a dialog with a five-column, three-row grid (the grid is shown overlaid in magenta):</p>
<p class="centerAlign"><img src="images/qgridlayout.png" alt="A grid layout" /></p><p>Columns 0, 2 and 4 in this dialog fragment are made up of a <a href="qlabel.html">QLabel</a>, a <a href="qlineedit.html">QLineEdit</a>, and a QListBox. Columns 1 and 3 are placeholders made with <a href="qgridlayout.html#setColumnMinimumWidth">setColumnMinimumWidth</a>(). Row 0 consists of three <a href="qlabel.html">QLabel</a> objects, row 1 of three <a href="qlineedit.html">QLineEdit</a> objects and row 2 of three QListBox objects. We used placeholder columns (1 and 3) to get the right amount of space between the columns.</p>
<p>Note that the columns and rows are not equally wide or tall. If you want two columns to have the same width, you must set their minimum widths and stretch factors to be the same yourself. You do this using <a href="qgridlayout.html#setColumnMinimumWidth">setColumnMinimumWidth</a>() and <a href="qgridlayout.html#setColumnStretch">setColumnStretch</a>().</p>
<p>If the <a href="qgridlayout.html">QGridLayout</a> is not the top-level layout (i.e&#x2e; does not manage all of the widget's area and children), you must add it to its parent layout when you create it, but before you do anything with it. The normal way to add a layout is by calling <a href="qgridlayout.html#addLayout">addLayout</a>() on the parent layout.</p>
<p>Once you have added your layout you can start putting widgets and other layouts into the cells of your grid layout using <a href="qgridlayout.html#addWidget">addWidget</a>(), <a href="qgridlayout.html#addItem">addItem</a>(), and <a href="qgridlayout.html#addLayout">addLayout</a>().</p>
<p><a href="qgridlayout.html">QGridLayout</a> also includes two margin widths: the <a href="qlayout.html#getContentsMargins">contents margin</a> and the <a href="qgridlayout.html#spacing">spacing</a>(). The contents margin is the width of the reserved space along each of the <a href="qgridlayout.html">QGridLayout</a>'s four sides. The <a href="qgridlayout.html#spacing">spacing</a>() is the width of the automatically allocated spacing between neighboring boxes.</p>
<p>The default contents margin values are provided by the <a href="qstyle.html#pixelMetric">style</a>. The default value 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>
</div>
<p><b>See also </b><a href="qboxlayout.html">QBoxLayout</a>, <a href="qstackedlayout.html">QStackedLayout</a>, <a href="layout.html">Layout Management</a>, and <a href="qtwidgets-layouts-basiclayouts-example.html">Basic Layouts Example</a>.</p>
<!-- @@@QGridLayout -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$horizontalSpacing-prop$$$horizontalSpacing$$$setHorizontalSpacingint -->
<h3 class="fn" id="horizontalSpacing-prop"><a name="horizontalSpacing-prop"></a><span class="name">horizontalSpacing</span> : <span class="type">int</span></h3>
<p>This property holds the spacing between widgets that are laid out side by side</p>
<p>If no value is explicitly set, the layout's horizontal spacing is inherited from the parent layout, or from the style settings for the parent widget.</p>
<p>This property was introduced in  Qt 4.3.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>horizontalSpacing</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setHorizontalSpacing</b></span>(int <i>spacing</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qgridlayout.html#verticalSpacing-prop">verticalSpacing</a>, <a href="qstyle.html#pixelMetric">QStyle::pixelMetric</a>(), and <a href="qstyle.html#PixelMetric-enum">PM_LayoutHorizontalSpacing</a>.</p>
<!-- @@@horizontalSpacing -->
<!-- $$$verticalSpacing-prop$$$verticalSpacing$$$setVerticalSpacingint -->
<h3 class="fn" id="verticalSpacing-prop"><a name="verticalSpacing-prop"></a><span class="name">verticalSpacing</span> : <span class="type">int</span></h3>
<p>This property holds the spacing between widgets that are laid out on top of each other</p>
<p>If no value is explicitly set, the layout's vertical spacing is inherited from the parent layout, or from the style settings for the parent widget.</p>
<p>This property was introduced in  Qt 4.3.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>verticalSpacing</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setVerticalSpacing</b></span>(int <i>spacing</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qgridlayout.html#horizontalSpacing-prop">horizontalSpacing</a>, <a href="qstyle.html#pixelMetric">QStyle::pixelMetric</a>(), and <a href="qstyle.html#PixelMetric-enum">PM_LayoutHorizontalSpacing</a>.</p>
<!-- @@@verticalSpacing -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QGridLayout[overload1]$$$QGridLayoutQWidget* -->
<h3 class="fn" id="QGridLayout"><a name="QGridLayout"></a>QGridLayout::<span class="name">QGridLayout</span>(<span class="type"><a href="qwidget.html">QWidget</a></span> *<i>parent</i>)</h3>
<p>Constructs a new <a href="qgridlayout.html">QGridLayout</a> with parent widget, <i>parent</i>. The layout has one row and one column initially, and will expand when new items are inserted.</p>
<!-- @@@QGridLayout -->
<!-- $$$QGridLayout$$$QGridLayout -->
<h3 class="fn" id="QGridLayout-1"><a name="QGridLayout-1"></a>QGridLayout::<span class="name">QGridLayout</span>()</h3>
<p>Constructs a new grid layout.</p>
<p>You must insert this grid into another layout. You can insert widgets and layouts into this layout at any time, but laying out will not be performed before this is inserted into another layout.</p>
<!-- @@@QGridLayout -->
<!-- $$$~QGridLayout[overload1]$$$~QGridLayout -->
<h3 class="fn" id="dtor.QGridLayout"><a name="dtor.QGridLayout"></a><code>[virtual] </code>QGridLayout::<span class="name">~QGridLayout</span>()</h3>
<p>Destroys the grid layout. Geometry management is terminated if this is a top-level grid.</p>
<p>The layout's widgets aren't destroyed.</p>
<!-- @@@~QGridLayout -->
<!-- $$$addItem[overload1]$$$addItemQLayoutItem*intintintintQt::Alignment -->
<h3 class="fn" id="addItem"><a name="addItem"></a><span class="type">void</span> QGridLayout::<span class="name">addItem</span>(<span class="type"><a href="qlayoutitem.html#QLayoutItem">QLayoutItem</a></span> *<i>item</i>, <span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>column</i>, <span class="type">int</span> <i>rowSpan</i> = 1, <span class="type">int</span> <i>columnSpan</i> = 1, <span class="type"><a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> <i>alignment</i> = ...)</h3>
<p>Adds <i>item</i> at position <i>row</i>, <i>column</i>, spanning <i>rowSpan</i> rows and <i>columnSpan</i> columns, and aligns it according to <i>alignment</i>. If <i>rowSpan</i> and/or <i>columnSpan</i> is -1, then the item will extend to the bottom and/or right edge, respectively. The layout takes ownership of the <i>item</i>.</p>
<p><b>Warning:</b> Do not use this function to add child layouts or child widget items. Use <a href="qgridlayout.html#addLayout">addLayout</a>() or <a href="qgridlayout.html#addWidget">addWidget</a>() instead.</p>
<!-- @@@addItem -->
<!-- $$$addItem$$$addItemQLayoutItem* -->
<h3 class="fn" id="addItem-1"><a name="addItem-1"></a><code>[override virtual protected] </code><span class="type">void</span> QGridLayout::<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*intintQt::Alignment -->
<h3 class="fn" id="addLayout"><a name="addLayout"></a><span class="type">void</span> QGridLayout::<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>row</i>, <span class="type">int</span> <i>column</i>, <span class="type"><a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> <i>alignment</i> = ...)</h3>
<p>Places the <i>layout</i> at position (<i>row</i>, <i>column</i>) in the grid. The top-left position is (0, 0).</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>A non-zero alignment indicates that the layout should not grow to fill the available space but should be sized according to <a href="qgridlayout.html#sizeHint">sizeHint</a>().</p>
<p><i>layout</i> becomes a child of the grid layout.</p>
<!-- @@@addLayout -->
<!-- $$$addLayout$$$addLayoutQLayout*intintintintQt::Alignment -->
<h3 class="fn" id="addLayout-1"><a name="addLayout-1"></a><span class="type">void</span> QGridLayout::<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>row</i>, <span class="type">int</span> <i>column</i>, <span class="type">int</span> <i>rowSpan</i>, <span class="type">int</span> <i>columnSpan</i>, <span class="type"><a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> <i>alignment</i> = ...)</h3>
<p>This is an overloaded function.</p>
<p>This version adds the layout <i>layout</i> to the cell grid, spanning multiple rows/columns. The cell will start at <i>row</i>, <i>column</i> spanning <i>rowSpan</i> rows and <i>columnSpan</i> columns.</p>
<p>If <i>rowSpan</i> and/or <i>columnSpan</i> is -1, then the layout will extend to the bottom and/or right edge, respectively.</p>
<!-- @@@addLayout -->
<!-- $$$addWidget[overload1]$$$addWidgetQWidget*intintQt::Alignment -->
<h3 class="fn" id="addWidget"><a name="addWidget"></a><span class="type">void</span> QGridLayout::<span class="name">addWidget</span>(<span class="type"><a href="qwidget.html">QWidget</a></span> *<i>widget</i>, <span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>column</i>, <span class="type"><a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> <i>alignment</i> = ...)</h3>
<p>Adds the given <i>widget</i> to the cell grid at <i>row</i>, <i>column</i>. The top-left position is (0, 0) by default.</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>
<!-- @@@addWidget -->
<!-- $$$addWidget$$$addWidgetQWidget*intintintintQt::Alignment -->
<h3 class="fn" id="addWidget-2"><a name="addWidget-2"></a><span class="type">void</span> QGridLayout::<span class="name">addWidget</span>(<span class="type"><a href="qwidget.html">QWidget</a></span> *<i>widget</i>, <span class="type">int</span> <i>fromRow</i>, <span class="type">int</span> <i>fromColumn</i>, <span class="type">int</span> <i>rowSpan</i>, <span class="type">int</span> <i>columnSpan</i>, <span class="type"><a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> <i>alignment</i> = ...)</h3>
<p>This is an overloaded function.</p>
<p>This version adds the given <i>widget</i> to the cell grid, spanning multiple rows/columns. The cell will start at <i>fromRow</i>, <i>fromColumn</i> spanning <i>rowSpan</i> rows and <i>columnSpan</i> columns. The <i>widget</i> will have the given <i>alignment</i>.</p>
<p>If <i>rowSpan</i> and/or <i>columnSpan</i> is -1, then the widget will extend to the bottom and/or right edge, respectively.</p>
<!-- @@@addWidget -->
<!-- $$$cellRect[overload1]$$$cellRectintint -->
<h3 class="fn" id="cellRect"><a name="cellRect"></a><span class="type"><a href="../qtcore/qrect.html">QRect</a></span> QGridLayout::<span class="name">cellRect</span>(<span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>column</i>) const</h3>
<p>Returns the geometry of the cell with row <i>row</i> and column <i>column</i> in the grid. Returns an invalid rectangle if <i>row</i> or <i>column</i> is outside the grid.</p>
<p><b>Warning:</b> in the current version of Qt this function does not return valid results until <a href="qgridlayout.html#setGeometry">setGeometry</a>() has been called, i.e&#x2e; after the <a href="qlayout.html#parentWidget">parentWidget</a>() is visible.</p>
<!-- @@@cellRect -->
<!-- $$$columnCount[overload1]$$$columnCount -->
<h3 class="fn" id="columnCount"><a name="columnCount"></a><span class="type">int</span> QGridLayout::<span class="name">columnCount</span>() const</h3>
<p>Returns the number of columns in this grid.</p>
<!-- @@@columnCount -->
<!-- $$$columnMinimumWidth[overload1]$$$columnMinimumWidthint -->
<h3 class="fn" id="columnMinimumWidth"><a name="columnMinimumWidth"></a><span class="type">int</span> QGridLayout::<span class="name">columnMinimumWidth</span>(<span class="type">int</span> <i>column</i>) const</h3>
<p>Returns the column spacing for column <i>column</i>.</p>
<p><b>See also </b><a href="qgridlayout.html#setColumnMinimumWidth">setColumnMinimumWidth</a>().</p>
<!-- @@@columnMinimumWidth -->
<!-- $$$columnStretch[overload1]$$$columnStretchint -->
<h3 class="fn" id="columnStretch"><a name="columnStretch"></a><span class="type">int</span> QGridLayout::<span class="name">columnStretch</span>(<span class="type">int</span> <i>column</i>) const</h3>
<p>Returns the stretch factor for column <i>column</i>.</p>
<p><b>See also </b><a href="qgridlayout.html#setColumnStretch">setColumnStretch</a>().</p>
<!-- @@@columnStretch -->
<!-- $$$count[overload1]$$$count -->
<h3 class="fn" id="count"><a name="count"></a><code>[override virtual] </code><span class="type">int</span> QGridLayout::<span class="name">count</span>() const</h3>
<p>Reimplemented from <a href="qlayout.html#count">QLayout::count</a>().</p>
<!-- @@@count -->
<!-- $$$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> QGridLayout::<span class="name">expandingDirections</span>() const</h3>
<p>Reimplemented from <a href="qlayout.html#expandingDirections">QLayout::expandingDirections</a>().</p>
<!-- @@@expandingDirections -->
<!-- $$$getItemPosition[overload1]$$$getItemPositionintint*int*int*int* -->
<h3 class="fn" id="getItemPosition"><a name="getItemPosition"></a><span class="type">void</span> QGridLayout::<span class="name">getItemPosition</span>(<span class="type">int</span> <i>index</i>, <span class="type">int</span> *<i>row</i>, <span class="type">int</span> *<i>column</i>, <span class="type">int</span> *<i>rowSpan</i>, <span class="type">int</span> *<i>columnSpan</i>) const</h3>
<p>Returns the position information of the item with the given <i>index</i>.</p>
<p>The variables passed as <i>row</i> and <i>column</i> are updated with the position of the item in the layout, and the <i>rowSpan</i> and <i>columnSpan</i> variables are updated with the vertical and horizontal spans of the item.</p>
<p><b>See also </b><a href="qgridlayout.html#itemAtPosition">itemAtPosition</a>() and <a href="qgridlayout.html#itemAt">itemAt</a>().</p>
<!-- @@@getItemPosition -->
<!-- $$$hasHeightForWidth[overload1]$$$hasHeightForWidth -->
<h3 class="fn" id="hasHeightForWidth"><a name="hasHeightForWidth"></a><code>[override virtual] </code><span class="type">bool</span> QGridLayout::<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> QGridLayout::<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 -->
<!-- $$$invalidate[overload1]$$$invalidate -->
<h3 class="fn" id="invalidate"><a name="invalidate"></a><code>[override virtual] </code><span class="type">void</span> QGridLayout::<span class="name">invalidate</span>()</h3>
<p>Reimplemented from <a href="qlayout.html#invalidate">QLayout::invalidate</a>().</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> *QGridLayout::<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 -->
<!-- $$$itemAtPosition[overload1]$$$itemAtPositionintint -->
<h3 class="fn" id="itemAtPosition"><a name="itemAtPosition"></a><span class="type"><a href="qlayoutitem.html#QLayoutItem">QLayoutItem</a></span> *QGridLayout::<span class="name">itemAtPosition</span>(<span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>column</i>) const</h3>
<p>Returns the layout item that occupies cell (<i>row</i>, <i>column</i>), or 0 if the cell is empty.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgridlayout.html#getItemPosition">getItemPosition</a>() and <a href="qlayout.html#indexOf">indexOf</a>().</p>
<!-- @@@itemAtPosition -->
<!-- $$$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> QGridLayout::<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> QGridLayout::<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> QGridLayout::<span class="name">minimumSize</span>() const</h3>
<p>Reimplemented from <a href="qlayout.html#minimumSize">QLayout::minimumSize</a>().</p>
<!-- @@@minimumSize -->
<!-- $$$originCorner[overload1]$$$originCorner -->
<h3 class="fn" id="originCorner"><a name="originCorner"></a><span class="type"><a href="../qtcore/qt.html#Corner-enum">Qt::Corner</a></span> QGridLayout::<span class="name">originCorner</span>() const</h3>
<p>Returns the corner that's used for the grid's origin, i.e&#x2e; for position (0, 0).</p>
<p><b>See also </b><a href="qgridlayout.html#setOriginCorner">setOriginCorner</a>().</p>
<!-- @@@originCorner -->
<!-- $$$rowCount[overload1]$$$rowCount -->
<h3 class="fn" id="rowCount"><a name="rowCount"></a><span class="type">int</span> QGridLayout::<span class="name">rowCount</span>() const</h3>
<p>Returns the number of rows in this grid.</p>
<!-- @@@rowCount -->
<!-- $$$rowMinimumHeight[overload1]$$$rowMinimumHeightint -->
<h3 class="fn" id="rowMinimumHeight"><a name="rowMinimumHeight"></a><span class="type">int</span> QGridLayout::<span class="name">rowMinimumHeight</span>(<span class="type">int</span> <i>row</i>) const</h3>
<p>Returns the minimum width set for row <i>row</i>.</p>
<p><b>See also </b><a href="qgridlayout.html#setRowMinimumHeight">setRowMinimumHeight</a>().</p>
<!-- @@@rowMinimumHeight -->
<!-- $$$rowStretch[overload1]$$$rowStretchint -->
<h3 class="fn" id="rowStretch"><a name="rowStretch"></a><span class="type">int</span> QGridLayout::<span class="name">rowStretch</span>(<span class="type">int</span> <i>row</i>) const</h3>
<p>Returns the stretch factor for row <i>row</i>.</p>
<p><b>See also </b><a href="qgridlayout.html#setRowStretch">setRowStretch</a>().</p>
<!-- @@@rowStretch -->
<!-- $$$setColumnMinimumWidth[overload1]$$$setColumnMinimumWidthintint -->
<h3 class="fn" id="setColumnMinimumWidth"><a name="setColumnMinimumWidth"></a><span class="type">void</span> QGridLayout::<span class="name">setColumnMinimumWidth</span>(<span class="type">int</span> <i>column</i>, <span class="type">int</span> <i>minSize</i>)</h3>
<p>Sets the minimum width of column <i>column</i> to <i>minSize</i> pixels.</p>
<p><b>See also </b><a href="qgridlayout.html#columnMinimumWidth">columnMinimumWidth</a>() and <a href="qgridlayout.html#setRowMinimumHeight">setRowMinimumHeight</a>().</p>
<!-- @@@setColumnMinimumWidth -->
<!-- $$$setColumnStretch[overload1]$$$setColumnStretchintint -->
<h3 class="fn" id="setColumnStretch"><a name="setColumnStretch"></a><span class="type">void</span> QGridLayout::<span class="name">setColumnStretch</span>(<span class="type">int</span> <i>column</i>, <span class="type">int</span> <i>stretch</i>)</h3>
<p>Sets the stretch factor of column <i>column</i> to <i>stretch</i>. The first column is number 0.</p>
<p>The stretch factor is relative to the other columns in this grid. Columns with a higher stretch factor take more of the available space.</p>
<p>The default stretch factor is 0. If the stretch factor is 0 and no other column in this table can grow at all, the column may still grow.</p>
<p>An alternative approach is to add spacing using <a href="qgridlayout.html#addItem">addItem</a>() with a <a href="qspaceritem.html">QSpacerItem</a>.</p>
<p><b>See also </b><a href="qgridlayout.html#columnStretch">columnStretch</a>() and <a href="qgridlayout.html#setRowStretch">setRowStretch</a>().</p>
<!-- @@@setColumnStretch -->
<!-- $$$setGeometry[overload1]$$$setGeometryconstQRect& -->
<h3 class="fn" id="setGeometry"><a name="setGeometry"></a><code>[override virtual] </code><span class="type">void</span> QGridLayout::<span class="name">setGeometry</span>(const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> &amp;<i>rect</i>)</h3>
<p>Reimplemented from <a href="qlayout.html#setGeometry">QLayout::setGeometry</a>().</p>
<!-- @@@setGeometry -->
<!-- $$$setOriginCorner[overload1]$$$setOriginCornerQt::Corner -->
<h3 class="fn" id="setOriginCorner"><a name="setOriginCorner"></a><span class="type">void</span> QGridLayout::<span class="name">setOriginCorner</span>(<span class="type"><a href="../qtcore/qt.html#Corner-enum">Qt::Corner</a></span> <i>corner</i>)</h3>
<p>Sets the grid's origin corner, i.e&#x2e; position (0, 0), to <i>corner</i>.</p>
<p><b>See also </b><a href="qgridlayout.html#originCorner">originCorner</a>().</p>
<!-- @@@setOriginCorner -->
<!-- $$$setRowMinimumHeight[overload1]$$$setRowMinimumHeightintint -->
<h3 class="fn" id="setRowMinimumHeight"><a name="setRowMinimumHeight"></a><span class="type">void</span> QGridLayout::<span class="name">setRowMinimumHeight</span>(<span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>minSize</i>)</h3>
<p>Sets the minimum height of row <i>row</i> to <i>minSize</i> pixels.</p>
<p><b>See also </b><a href="qgridlayout.html#rowMinimumHeight">rowMinimumHeight</a>() and <a href="qgridlayout.html#setColumnMinimumWidth">setColumnMinimumWidth</a>().</p>
<!-- @@@setRowMinimumHeight -->
<!-- $$$setRowStretch[overload1]$$$setRowStretchintint -->
<h3 class="fn" id="setRowStretch"><a name="setRowStretch"></a><span class="type">void</span> QGridLayout::<span class="name">setRowStretch</span>(<span class="type">int</span> <i>row</i>, <span class="type">int</span> <i>stretch</i>)</h3>
<p>Sets the stretch factor of row <i>row</i> to <i>stretch</i>. The first row is number 0.</p>
<p>The stretch factor is relative to the other rows in this grid. Rows with a higher stretch factor take more of the available space.</p>
<p>The default stretch factor is 0. If the stretch factor is 0 and no other row in this table can grow at all, the row may still grow.</p>
<p><b>See also </b><a href="qgridlayout.html#rowStretch">rowStretch</a>(), <a href="qgridlayout.html#setRowMinimumHeight">setRowMinimumHeight</a>(), and <a href="qgridlayout.html#setColumnStretch">setColumnStretch</a>().</p>
<!-- @@@setRowStretch -->
<!-- $$$setSpacing[overload1]$$$setSpacingint -->
<h3 class="fn" id="setSpacing"><a name="setSpacing"></a><span class="type">void</span> QGridLayout::<span class="name">setSpacing</span>(<span class="type">int</span> <i>spacing</i>)</h3>
<p>This function sets both the vertical and horizontal spacing to <i>spacing</i>.</p>
<p><b>See also </b><a href="qgridlayout.html#spacing">spacing</a>(), <a href="qgridlayout.html#verticalSpacing-prop">setVerticalSpacing</a>(), and <a href="qgridlayout.html#horizontalSpacing-prop">setHorizontalSpacing</a>().</p>
<!-- @@@setSpacing -->
<!-- $$$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> QGridLayout::<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> QGridLayout::<span class="name">spacing</span>() const</h3>
<p>If the vertical spacing is equal to the horizontal spacing, this function returns that value; otherwise it return -1.</p>
<p><b>See also </b><a href="qgridlayout.html#setSpacing">setSpacing</a>(), <a href="qgridlayout.html#verticalSpacing-prop">verticalSpacing</a>(), and <a href="qgridlayout.html#horizontalSpacing-prop">horizontalSpacing</a>().</p>
<!-- @@@spacing -->
<!-- $$$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> *QGridLayout::<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>