<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qlayout.cpp --> <title>Qt 4.8: Qt 3 Support Members for QLayout</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> <li><a href="modules.html">Modules</a></li> <li><a href="qtgui.html">QtGui</a></li> <li>QLayout</li> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content mainContent"> <h1 class="title">Qt 3 Support Members for QLayout</h1> <p><b>The following class members are part of the <a href="qt3support.html">Qt 3 support layer</a>.</b> They are provided to help you port old code to Qt 4. We advise against using them in new code.</p> <p><ul><li><a href="qlayout.html">QLayout class reference</a></li></ul></p> <h2>Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qlayout-qt3.html#QLayout-4">QLayout</a></b> ( QWidget * <i>parent</i>, int <i>margin</i>, int <i>spacing</i> = -1, const char * <i>name</i> = 0 )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qlayout-qt3.html#QLayout-5">QLayout</a></b> ( QLayout * <i>parentLayout</i>, int <i>spacing</i> = -1, const char * <i>name</i> = 0 )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qlayout-qt3.html#QLayout-6">QLayout</a></b> ( int <i>spacing</i>, const char * <i>name</i> = 0 )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlayout-qt3.html#add">add</a></b> ( QWidget * <i>widget</i> )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlayout-qt3.html#autoAdd">autoAdd</a></b> () const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qlayout-qt3.html#defaultBorder">defaultBorder</a></b> () const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlayout-qt3.html#freeze">freeze</a></b> ( int <i>w</i> = 0, int <i>h</i> = 0 )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlayout-qt3.html#isTopLevel">isTopLevel</a></b> () const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> QLayoutIterator </td><td class="memItemRight bottomAlign"><b><a href="qlayout-qt3.html#iterator">iterator</a></b> ()</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qlayout-qt3.html#mainWidget">mainWidget</a></b> () const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlayout-qt3.html#remove">remove</a></b> ( QWidget * <i>widget</i> )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> SizeConstraint </td><td class="memItemRight bottomAlign"><b><a href="qlayout-qt3.html#resizeMode">resizeMode</a></b> () const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlayout-qt3.html#setAutoAdd">setAutoAdd</a></b> ( bool <i>a</i> )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlayout-qt3.html#setResizeMode">setResizeMode</a></b> ( SizeConstraint <i>constraint</i> )</td></tr> </table> <ul> <li class="fn">8 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li> </ul> <h2>Protected Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlayout-qt3.html#deleteAllItems">deleteAllItems</a></b> ()</td></tr> </table> <ul> <li class="fn">1 protected function inherited from <a href="qobject.html#protected-functions">QObject</a></li> </ul> <h2>Member Function Documentation</h2> <!-- $$$QLayout$$$QLayoutQWidget*intintconstchar* --> <h3 class="fn"><a name="QLayout-4"></a>QLayout::<span class="name">QLayout</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i>, <span class="type">int</span> <i>margin</i>, <span class="type">int</span> <i>spacing</i> = -1, const <span class="type">char</span> * <i>name</i> = 0 )</h3> <p>Constructs a new top-level <a href="qlayout.html">QLayout</a> called <i>name</i>, with parent widget <i>parent</i>. <i>parent</i> may not be 0.</p> <p>The <i>margin</i> is the number of pixels between the edge of the widget and the managed children. The <i>spacing</i> sets the value of <a href="qlayout.html#spacing-prop">spacing</a>(), which gives the spacing between the managed widgets. If <i>spacing</i> is -1 (the default), spacing is set to the value of <i>margin</i>.</p> <p>There can be only one top-level layout for a widget. It is returned by <a href="qwidget.html#layout">QWidget::layout</a>()</p> <p><b>See also </b><a href="qwidget.html#setLayout">QWidget::setLayout</a>().</p> <!-- @@@QLayout --> <!-- $$$QLayout$$$QLayoutQLayout*intconstchar* --> <h3 class="fn"><a name="QLayout-5"></a>QLayout::<span class="name">QLayout</span> ( <span class="type">QLayout</span> * <i>parentLayout</i>, <span class="type">int</span> <i>spacing</i> = -1, const <span class="type">char</span> * <i>name</i> = 0 )</h3> <p>Constructs a new child <a href="qlayout.html">QLayout</a> called <i>name</i>, and places it inside <i>parentLayout</i> by using the default placement defined by <a href="qlayout.html#addItem">addItem</a>().</p> <p>If <i>spacing</i> is -1, this <a href="qlayout.html">QLayout</a> inherits <i>parentLayout</i>'s <a href="qlayout.html#spacing-prop">spacing</a>(), otherwise the value of <i>spacing</i> is used.</p> <!-- @@@QLayout --> <!-- $$$QLayout$$$QLayoutintconstchar* --> <h3 class="fn"><a name="QLayout-6"></a>QLayout::<span class="name">QLayout</span> ( <span class="type">int</span> <i>spacing</i>, const <span class="type">char</span> * <i>name</i> = 0 )</h3> <p>Constructs a new child <a href="qlayout.html">QLayout</a> called <i>name</i>. If <i>spacing</i> is -1, this <a href="qlayout.html">QLayout</a> inherits its parent's <a href="qlayout.html#spacing-prop">spacing</a>(); otherwise the value of <i>spacing</i> is used.</p> <p>This layout has to be inserted into another layout before geometry management will work.</p> <!-- @@@QLayout --> <!-- $$$add[overload1]$$$addQWidget* --> <h3 class="fn"><a name="add"></a><span class="type">void</span> QLayout::<span class="name">add</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i> )</h3> <p>Use addWidget(<i>widget</i>) instead.</p> <!-- @@@add --> <!-- $$$autoAdd[overload1]$$$autoAdd --> <h3 class="fn"><a name="autoAdd"></a><span class="type">bool</span> QLayout::<span class="name">autoAdd</span> () const</h3> <p>Automatically adding widgets is deprecated. Use <a href="qlayout.html#addWidget">addWidget</a>() or addLayout() instead.</p> <p><b>See also </b><a href="qlayout-qt3.html#setAutoAdd">setAutoAdd</a>().</p> <!-- @@@autoAdd --> <!-- $$$defaultBorder[overload1]$$$defaultBorder --> <h3 class="fn"><a name="defaultBorder"></a><span class="type">int</span> QLayout::<span class="name">defaultBorder</span> () const</h3> <p>Use <a href="qlayout.html#spacing-prop">spacing</a>() instead.</p> <!-- @@@defaultBorder --> <!-- $$$deleteAllItems[overload1]$$$deleteAllItems --> <h3 class="fn"><a name="deleteAllItems"></a><span class="type">void</span> QLayout::<span class="name">deleteAllItems</span> ()<tt> [protected]</tt></h3> <p>Removes and deletes all items in this layout.</p> <!-- @@@deleteAllItems --> <!-- $$$freeze[overload1]$$$freezeintint --> <h3 class="fn"><a name="freeze"></a><span class="type">void</span> QLayout::<span class="name">freeze</span> ( <span class="type">int</span> <i>w</i> = 0, <span class="type">int</span> <i>h</i> = 0 )</h3> <p>Sets this layout's parent widget to a fixed size with width <i>w</i> and height <i>h</i>, stopping the user from resizing it, and also prevents the layout from resizing it, even if the layout's size hint should change. Does nothing if this is not a top-level layout (i.e., if <a href="qobject.html#parent">parent</a>()-><a href="qobject.html#isWidgetType">isWidgetType</a>()).</p> <p>As a special case, if both <i>w</i> and <i>h</i> are 0, then the layout's current <a href="qlayoutitem.html#sizeHint">sizeHint</a>() is used.</p> <p>Use <tt>setResizeMode(Fixed)</tt> to stop the widget from being resized by the user, while still allowing the layout to resize it when the <a href="qlayoutitem.html#sizeHint">sizeHint</a>() changes.</p> <p>Use <tt>setResizeMode(FreeResize)</tt> to allow the user to resize the widget, while preventing the layout from resizing it.</p> <!-- @@@freeze --> <!-- $$$isTopLevel[overload1]$$$isTopLevel --> <h3 class="fn"><a name="isTopLevel"></a><span class="type">bool</span> QLayout::<span class="name">isTopLevel</span> () const</h3> <p>Returns true if this layout is a top-level layout, i.e. not a child of another layout; otherwise returns false.</p> <!-- @@@isTopLevel --> <!-- $$$iterator[overload1]$$$iterator --> <h3 class="fn"><a name="iterator"></a><span class="type">QLayoutIterator</span> QLayout::<span class="name">iterator</span> ()</h3> <p>Use a <a href="porting4.html#qlayoutiterator">QLayoutIterator</a>() constructor instead.</p> <!-- @@@iterator --> <!-- $$$mainWidget[overload1]$$$mainWidget --> <h3 class="fn"><a name="mainWidget"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QLayout::<span class="name">mainWidget</span> () const</h3> <p>Use <a href="qlayout.html#parentWidget">parentWidget</a>() instead.</p> <!-- @@@mainWidget --> <!-- $$$remove[overload1]$$$removeQWidget* --> <h3 class="fn"><a name="remove"></a><span class="type">void</span> QLayout::<span class="name">remove</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i> )</h3> <p>Use removeWidget(<i>widget</i>) instead.</p> <!-- @@@remove --> <!-- $$$resizeMode[overload1]$$$resizeMode --> <h3 class="fn"><a name="resizeMode"></a><span class="type"><a href="qlayout.html#SizeConstraint-enum">SizeConstraint</a></span> QLayout::<span class="name">resizeMode</span> () const</h3> <p>Use <a href="qlayout.html#sizeConstraint-prop">sizeConstraint</a>() instead.</p> <p><b>See also </b><a href="qlayout-qt3.html#setResizeMode">setResizeMode</a>().</p> <!-- @@@resizeMode --> <!-- $$$setAutoAdd[overload1]$$$setAutoAddbool --> <h3 class="fn"><a name="setAutoAdd"></a><span class="type">void</span> QLayout::<span class="name">setAutoAdd</span> ( <span class="type">bool</span> <i>a</i> )</h3> <p>Automatically adding widgets is deprecated. Use <a href="qlayout.html#addWidget">addWidget</a>() or addLayout() instead.</p> <p><b>See also </b><a href="qlayout-qt3.html#autoAdd">autoAdd</a>().</p> <!-- @@@setAutoAdd --> <!-- $$$setResizeMode[overload1]$$$setResizeModeSizeConstraint --> <h3 class="fn"><a name="setResizeMode"></a><span class="type">void</span> QLayout::<span class="name">setResizeMode</span> ( <span class="type"><a href="qlayout.html#SizeConstraint-enum">SizeConstraint</a></span> <i>constraint</i> )</h3> <p>Use setSizeConstraint(<i>constraint</i>) instead.</p> <p><b>See also </b><a href="qlayout-qt3.html#resizeMode">resizeMode</a>().</p> <!-- @@@setResizeMode --> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its subsidiaries. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> 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.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>