<?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" /> <!-- qstackedlayout.cpp --> <title>Qt 4.8: QStackedLayout Class Reference</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>QStackedLayout</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"> <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="#properties">Properties</a></li> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#public-slots">Public Slots</a></li> <li class="level1"><a href="#signals">Signals</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <h1 class="title">QStackedLayout Class Reference</h1> <!-- $$$QStackedLayout-brief --> <p>The QStackedLayout class provides a stack of widgets where only one widget is visible at a time. <a href="#details">More...</a></p> <!-- @@@QStackedLayout --> <pre class="cpp"> <span class="preprocessor">#include <QStackedLayout></span></pre><p><b>Inherits: </b><a href="qlayout.html">QLayout</a>.</p> <ul> <li><a href="qstackedlayout-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-types"></a> <h2>Public Types</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#StackingMode-enum">StackingMode</a></b> { StackOne, StackAll }</td></tr> </table> <a name="properties"></a> <h2>Properties</h2> <ul> <li class="fn"><b><a href="qstackedlayout.html#count-prop">count</a></b> : const int</li> <li class="fn"><b><a href="qstackedlayout.html#currentIndex-prop">currentIndex</a></b> : int</li> <li class="fn"><b><a href="qstackedlayout.html#stackingMode-prop">stackingMode</a></b> : StackingMode</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="qobject.html#properties">QObject</a></li> </ul> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#QStackedLayout">QStackedLayout</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#QStackedLayout-2">QStackedLayout</a></b> ( QWidget * <i>parent</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#QStackedLayout-3">QStackedLayout</a></b> ( QLayout * <i>parentLayout</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#dtor.QStackedLayout">~QStackedLayout</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#addWidget">addWidget</a></b> ( QWidget * <i>widget</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#currentIndex-prop">currentIndex</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#currentWidget">currentWidget</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#insertWidget">insertWidget</a></b> ( int <i>index</i>, QWidget * <i>widget</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#stackingMode-prop">setStackingMode</a></b> ( StackingMode <i>stackingMode</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> StackingMode </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#stackingMode-prop">stackingMode</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#widget">widget</a></b> ( int <i>index</i> ) const</td></tr> </table> <a name="reimplemented-public-functions"></a> <h2>Reimplemented Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#addItem">addItem</a></b> ( QLayoutItem * <i>item</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#count-prop">count</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual QLayoutItem * </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#itemAt">itemAt</a></b> ( int <i>index</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#minimumSize">minimumSize</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#setGeometry">setGeometry</a></b> ( const QRect & <i>rect</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#sizeHint">sizeHint</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual QLayoutItem * </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#takeAt">takeAt</a></b> ( int <i>index</i> )</td></tr> </table> <ul> <li class="fn">35 public functions inherited from <a href="qlayout.html#public-functions">QLayout</a></li> <li class="fn">29 public functions inherited from <a href="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="public-slots"></a> <h2>Public Slots</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#currentIndex-prop">setCurrentIndex</a></b> ( int <i>index</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#setCurrentWidget">setCurrentWidget</a></b> ( QWidget * <i>widget</i> )</td></tr> </table> <ul> <li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li> </ul> <a name="signals"></a> <h2>Signals</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#currentChanged">currentChanged</a></b> ( int <i>index</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qstackedlayout.html#widgetRemoved">widgetRemoved</a></b> ( int <i>index</i> )</td></tr> </table> <ul> <li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li class="fn">1 static public member inherited from <a href="qlayout.html#static-public-members">QLayout</a></li> <li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li> <li class="fn">4 protected functions inherited from <a href="qlayout.html#protected-functions">QLayout</a></li> <li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li> </ul> <a name="details"></a> <!-- $$$QStackedLayout-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The QStackedLayout class provides a stack of widgets where only one widget is visible at a time.</p> <p>QStackedLayout can be used to create a user interface similar to the one provided by <a href="qtabwidget.html">QTabWidget</a>. There is also a convenience <a href="qstackedwidget.html">QStackedWidget</a> class built on top of QStackedLayout.</p> <p>A QStackedLayout can be populated with a number of child widgets ("pages"). For example:</p> <pre class="cpp"> <span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>firstPageWidget <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qwidget.html">QWidget</a></span>; <span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>secondPageWidget <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qwidget.html">QWidget</a></span>; <span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>thirdPageWidget <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qwidget.html">QWidget</a></span>; <span class="type">QStackedLayout</span> <span class="operator">*</span>stackedLayout <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QStackedLayout</span>; stackedLayout<span class="operator">-</span><span class="operator">></span>addWidget(firstPageWidget); stackedLayout<span class="operator">-</span><span class="operator">></span>addWidget(secondPageWidget); stackedLayout<span class="operator">-</span><span class="operator">></span>addWidget(thirdPageWidget); <span class="type"><a href="qvboxlayout.html">QVBoxLayout</a></span> <span class="operator">*</span>mainLayout <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qvboxlayout.html">QVBoxLayout</a></span>; mainLayout<span class="operator">-</span><span class="operator">></span>addLayout(stackedLayout); setLayout(mainLayout);</pre> <p>QStackedLayout provides no intrinsic means for the user to switch page. This is typically done through a <a href="qcombobox.html">QComboBox</a> or a <a href="qlistwidget.html">QListWidget</a> that stores the titles of the QStackedLayout's pages. For example:</p> <pre class="cpp"> <span class="type"><a href="qcombobox.html">QComboBox</a></span> <span class="operator">*</span>pageComboBox <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qcombobox.html">QComboBox</a></span>; pageComboBox<span class="operator">-</span><span class="operator">></span>addItem(tr(<span class="string">"Page 1"</span>)); pageComboBox<span class="operator">-</span><span class="operator">></span>addItem(tr(<span class="string">"Page 2"</span>)); pageComboBox<span class="operator">-</span><span class="operator">></span>addItem(tr(<span class="string">"Page 3"</span>)); connect(pageComboBox<span class="operator">,</span> SIGNAL(activated(<span class="type">int</span>))<span class="operator">,</span> stackedLayout<span class="operator">,</span> SLOT(setCurrentIndex(<span class="type">int</span>)));</pre> <p>When populating a layout, the widgets are added to an internal list. The <a href="qlayout.html#indexOf">indexOf</a>() function returns the index of a widget in that list. The widgets can either be added to the end of the list using the <a href="qstackedlayout.html#addWidget">addWidget</a>() function, or inserted at a given index using the <a href="qstackedlayout.html#insertWidget">insertWidget</a>() function. The <a href="qlayout.html#removeWidget">removeWidget</a>() function removes the widget at the given index from the layout. The number of widgets contained in the layout, can be obtained using the <a href="qstackedlayout.html#count-prop">count</a>() function.</p> <p>The <a href="qstackedlayout.html#widget">widget</a>() function returns the widget at a given index position. The index of the widget that is shown on screen is given by <a href="qstackedlayout.html#currentIndex-prop">currentIndex</a>() and can be changed using <a href="qstackedlayout.html#currentIndex-prop">setCurrentIndex</a>(). In a similar manner, the currently shown widget can be retrieved using the <a href="qstackedlayout.html#currentWidget">currentWidget</a>() function, and altered using the <a href="qstackedlayout.html#setCurrentWidget">setCurrentWidget</a>() function.</p> <p>Whenever the current widget in the layout changes or a widget is removed from the layout, the <a href="qstackedlayout.html#currentChanged">currentChanged</a>() and <a href="qstackedlayout.html#widgetRemoved">widgetRemoved</a>() signals are emitted respectively.</p> </div> <p><b>See also </b><a href="qstackedwidget.html">QStackedWidget</a> and <a href="qtabwidget.html">QTabWidget</a>.</p> <!-- @@@QStackedLayout --> <div class="types"> <h2>Member Type Documentation</h2> <!-- $$$StackingMode$$$StackOne$$$StackAll --> <h3 class="fn"><a name="StackingMode-enum"></a>enum QStackedLayout::<span class="name">StackingMode</span></h3> <p>This enum specifies how the layout handles its child widgets regarding their visibility.</p> <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"><tt>QStackedLayout::StackOne</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">Only the current widget is visible. This is the default.</td></tr> <tr><td class="topAlign"><tt>QStackedLayout::StackAll</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">All widgets are visible. The current widget is merely raised.</td></tr> </table> <p>This enum was introduced or modified in Qt 4.4.</p> <!-- @@@StackingMode --> </div> <div class="prop"> <h2>Property Documentation</h2> <!-- $$$count-prop$$$count --> <h3 class="fn"><a name="count-prop"></a><span class="name">count</span> : const <span class="type">int</span></h3> <p>This property holds the number of widgets contained in the layout.</p> <p><b>Access functions:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> virtual int </td><td class="memItemRight bottomAlign"><span class="name"><b>count</b></span> () const</td></tr> </table> <p><b>See also </b><a href="qstackedlayout.html#currentIndex-prop">currentIndex</a>() and <a href="qstackedlayout.html#widget">widget</a>().</p> <!-- @@@count --> <!-- $$$currentIndex-prop$$$currentIndex$$$setCurrentIndexint$$$currentChangedint --> <h3 class="fn"><a name="currentIndex-prop"></a><span class="name">currentIndex</span> : <span class="type">int</span></h3> <p>This property holds the index position of the widget that is visible.</p> <p>The current index is -1 if there is no current widget.</p> <p><b>Access functions:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>currentIndex</b></span> () const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setCurrentIndex</b></span> ( int <i>index</i> )</td></tr> </table> <p><b>Notifier signal:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qstackedlayout.html#currentChanged">currentChanged</a></b></span> ( int <i>index</i> )</td></tr> </table> <p><b>See also </b><a href="qstackedlayout.html#currentWidget">currentWidget</a>() and <a href="qlayout.html#indexOf">indexOf</a>().</p> <!-- @@@currentIndex --> <!-- $$$stackingMode-prop$$$stackingMode$$$setStackingModeStackingMode --> <h3 class="fn"><a name="stackingMode-prop"></a><span class="name">stackingMode</span> : <span class="type"><a href="qstackedlayout.html#StackingMode-enum">StackingMode</a></span></h3> <p>This property determines the way visibility of child widgets are handled.</p> <p>The default value is <a href="qstackedlayout.html#StackingMode-enum">StackOne</a>. Setting the property to <a href="qstackedlayout.html#StackingMode-enum">StackAll</a> allows you to make use of the layout for overlay widgets that do additional drawing on top of other widgets, for example, graphical editors.</p> <p>This property was introduced in Qt 4.4.</p> <p><b>Access functions:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> StackingMode </td><td class="memItemRight bottomAlign"><span class="name"><b>stackingMode</b></span> () const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setStackingMode</b></span> ( StackingMode <i>stackingMode</i> )</td></tr> </table> <!-- @@@stackingMode --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QStackedLayout[overload1]$$$QStackedLayout --> <h3 class="fn"><a name="QStackedLayout"></a>QStackedLayout::<span class="name">QStackedLayout</span> ()</h3> <p>Constructs a <a href="qstackedlayout.html">QStackedLayout</a> with no parent.</p> <p>This <a href="qstackedlayout.html">QStackedLayout</a> must be installed on a widget later on to become effective.</p> <p><b>See also </b><a href="qstackedlayout.html#addWidget">addWidget</a>() and <a href="qstackedlayout.html#insertWidget">insertWidget</a>().</p> <!-- @@@QStackedLayout --> <!-- $$$QStackedLayout$$$QStackedLayoutQWidget* --> <h3 class="fn"><a name="QStackedLayout-2"></a>QStackedLayout::<span class="name">QStackedLayout</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> )</h3> <p>Constructs a new <a href="qstackedlayout.html">QStackedLayout</a> with the given <i>parent</i>.</p> <p>This layout will install itself on the <i>parent</i> widget and manage the geometry of its children.</p> <!-- @@@QStackedLayout --> <!-- $$$QStackedLayout$$$QStackedLayoutQLayout* --> <h3 class="fn"><a name="QStackedLayout-3"></a>QStackedLayout::<span class="name">QStackedLayout</span> ( <span class="type"><a href="qlayout.html">QLayout</a></span> * <i>parentLayout</i> )</h3> <p>Constructs a new <a href="qstackedlayout.html">QStackedLayout</a> and inserts it into the given <i>parentLayout</i>.</p> <!-- @@@QStackedLayout --> <!-- $$$~QStackedLayout[overload1]$$$~QStackedLayout --> <h3 class="fn"><a name="dtor.QStackedLayout"></a>QStackedLayout::<span class="name">~QStackedLayout</span> ()</h3> <p>Destroys this <a href="qstackedlayout.html">QStackedLayout</a>. Note that the layout's widgets are <i>not</i> destroyed.</p> <!-- @@@~QStackedLayout --> <!-- $$$addItem[overload1]$$$addItemQLayoutItem* --> <h3 class="fn"><a name="addItem"></a><span class="type">void</span> QStackedLayout::<span class="name">addItem</span> ( <span class="type"><a href="qlayoutitem.html">QLayoutItem</a></span> * <i>item</i> )<tt> [virtual]</tt></h3> <p>Reimplemented from <a href="qlayout.html#addItem">QLayout::addItem</a>().</p> <!-- @@@addItem --> <!-- $$$addWidget[overload1]$$$addWidgetQWidget* --> <h3 class="fn"><a name="addWidget"></a><span class="type">int</span> QStackedLayout::<span class="name">addWidget</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i> )</h3> <p>Adds the given <i>widget</i> to the end of this layout and returns the index position of the <i>widget</i>.</p> <p>If the <a href="qstackedlayout.html">QStackedLayout</a> is empty before this function is called, the given <i>widget</i> becomes the current widget.</p> <p><b>See also </b><a href="qstackedlayout.html#insertWidget">insertWidget</a>(), <a href="qlayout.html#removeWidget">removeWidget</a>(), and <a href="qstackedlayout.html#setCurrentWidget">setCurrentWidget</a>().</p> <!-- @@@addWidget --> <!-- $$$currentChanged[overload1]$$$currentChangedint --> <h3 class="fn"><a name="currentChanged"></a><span class="type">void</span> QStackedLayout::<span class="name">currentChanged</span> ( <span class="type">int</span> <i>index</i> )<tt> [signal]</tt></h3> <p>This signal is emitted whenever the current widget in the layout changes. The <i>index</i> specifies the index of the new current widget, or -1 if there isn't a new one (for example, if there are no widgets in the <a href="qstackedlayout.html">QStackedLayout</a>)</p> <p><b>See also </b><a href="qstackedlayout.html#currentWidget">currentWidget</a>() and <a href="qstackedlayout.html#setCurrentWidget">setCurrentWidget</a>().</p> <!-- @@@currentChanged --> <!-- $$$currentWidget[overload1]$$$currentWidget --> <h3 class="fn"><a name="currentWidget"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QStackedLayout::<span class="name">currentWidget</span> () const</h3> <p>Returns the current widget, or 0 if there are no widgets in this layout.</p> <p><b>See also </b><a href="qstackedlayout.html#currentIndex-prop">currentIndex</a>() and <a href="qstackedlayout.html#setCurrentWidget">setCurrentWidget</a>().</p> <!-- @@@currentWidget --> <!-- $$$insertWidget[overload1]$$$insertWidgetintQWidget* --> <h3 class="fn"><a name="insertWidget"></a><span class="type">int</span> QStackedLayout::<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> )</h3> <p>Inserts the given <i>widget</i> at the given <i>index</i> in this <a href="qstackedlayout.html">QStackedLayout</a>. If <i>index</i> is out of range, the widget is appended (in which case it is the actual index of the <i>widget</i> that is returned).</p> <p>If the <a href="qstackedlayout.html">QStackedLayout</a> is empty before this function is called, the given <i>widget</i> becomes the current widget.</p> <p>Inserting a new widget at an index less than or equal to the current index will increment the current index, but keep the current widget.</p> <p><b>See also </b><a href="qstackedlayout.html#addWidget">addWidget</a>(), <a href="qlayout.html#removeWidget">removeWidget</a>(), and <a href="qstackedlayout.html#setCurrentWidget">setCurrentWidget</a>().</p> <!-- @@@insertWidget --> <!-- $$$itemAt[overload1]$$$itemAtint --> <h3 class="fn"><a name="itemAt"></a><span class="type"><a href="qlayoutitem.html">QLayoutItem</a></span> * QStackedLayout::<span class="name">itemAt</span> ( <span class="type">int</span> <i>index</i> ) const<tt> [virtual]</tt></h3> <p>Reimplemented from <a href="qlayout.html#itemAt">QLayout::itemAt</a>().</p> <!-- @@@itemAt --> <!-- $$$minimumSize[overload1]$$$minimumSize --> <h3 class="fn"><a name="minimumSize"></a><span class="type"><a href="qsize.html">QSize</a></span> QStackedLayout::<span class="name">minimumSize</span> () const<tt> [virtual]</tt></h3> <p>Reimplemented from <a href="qlayoutitem.html#minimumSize">QLayoutItem::minimumSize</a>().</p> <!-- @@@minimumSize --> <!-- $$$setCurrentWidget[overload1]$$$setCurrentWidgetQWidget* --> <h3 class="fn"><a name="setCurrentWidget"></a><span class="type">void</span> QStackedLayout::<span class="name">setCurrentWidget</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i> )<tt> [slot]</tt></h3> <p>Sets the current widget to be the specified <i>widget</i>. The new current widget must already be contained in this stacked layout.</p> <p><b>See also </b><a href="qstackedlayout.html#currentIndex-prop">setCurrentIndex</a>() and <a href="qstackedlayout.html#currentWidget">currentWidget</a>().</p> <!-- @@@setCurrentWidget --> <!-- $$$setGeometry[overload1]$$$setGeometryconstQRect& --> <h3 class="fn"><a name="setGeometry"></a><span class="type">void</span> QStackedLayout::<span class="name">setGeometry</span> ( const <span class="type"><a href="qrect.html">QRect</a></span> & <i>rect</i> )<tt> [virtual]</tt></h3> <p>Reimplemented from <a href="qlayoutitem.html#setGeometry">QLayoutItem::setGeometry</a>().</p> <!-- @@@setGeometry --> <!-- $$$sizeHint[overload1]$$$sizeHint --> <h3 class="fn"><a name="sizeHint"></a><span class="type"><a href="qsize.html">QSize</a></span> QStackedLayout::<span class="name">sizeHint</span> () const<tt> [virtual]</tt></h3> <p>Reimplemented from <a href="qlayoutitem.html#sizeHint">QLayoutItem::sizeHint</a>().</p> <!-- @@@sizeHint --> <!-- $$$takeAt[overload1]$$$takeAtint --> <h3 class="fn"><a name="takeAt"></a><span class="type"><a href="qlayoutitem.html">QLayoutItem</a></span> * QStackedLayout::<span class="name">takeAt</span> ( <span class="type">int</span> <i>index</i> )<tt> [virtual]</tt></h3> <p>Reimplemented from <a href="qlayout.html#takeAt">QLayout::takeAt</a>().</p> <!-- @@@takeAt --> <!-- $$$widget[overload1]$$$widgetint --> <h3 class="fn"><a name="widget"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QStackedLayout::<span class="name">widget</span> ( <span class="type">int</span> <i>index</i> ) const</h3> <p>Returns the widget at the given <i>index</i>, or 0 if there is no widget at the given position.</p> <p><b>See also </b><a href="qstackedlayout.html#currentWidget">currentWidget</a>() and <a href="qlayout.html#indexOf">indexOf</a>().</p> <!-- @@@widget --> <!-- $$$widgetRemoved[overload1]$$$widgetRemovedint --> <h3 class="fn"><a name="widgetRemoved"></a><span class="type">void</span> QStackedLayout::<span class="name">widgetRemoved</span> ( <span class="type">int</span> <i>index</i> )<tt> [signal]</tt></h3> <p>This signal is emitted whenever a widget is removed from the layout. The widget's <i>index</i> is passed as parameter.</p> <p><b>See also </b><a href="qlayout.html#removeWidget">removeWidget</a>().</p> <!-- @@@widgetRemoved --> </div> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2015 The Qt Company Ltd. 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> 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. <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>