<class name="QStackedLayout" doc="/** <p>The <a href="QStackedLayout.html#QStackedLayout()"><tt>QStackedLayout</tt></a> class provides a stack of widgets where only one widget is visible at a time.</p> <p><a href="QStackedLayout.html#QStackedLayout()"><tt>QStackedLayout</tt></a> can be used to create a user interface similar to the one provided by <a href="QTabWidget.html"><tt>QTabWidget</tt></a>. There is also a convenience <a href="QStackedWidget.html"><tt>QStackedWidget</tt></a> class built on top of <a href="QStackedLayout.html#QStackedLayout()"><tt>QStackedLayout</tt></a>.</p> <p>A <a href="QStackedLayout.html#QStackedLayout()"><tt>QStackedLayout</tt></a> can be populated with a number of child widgets (&quot;pages&quot;). For example:</p> <pre> QWidget *firstPageWidget = new QWidget; QWidget *secondPageWidget = new QWidget; QWidget *thirdPageWidget = new QWidget; QStackedLayout *stackedLayout = new QStackedLayout; stackedLayout-&gt;addWidget(firstPageWidget); stackedLayout-&gt;addWidget(secondPageWidget); stackedLayout-&gt;addWidget(thirdPageWidget); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout-&gt;addLayout(stackedLayout); setLayout(mainLayout);</pre> <p><a href="QStackedLayout.html#QStackedLayout()"><tt>QStackedLayout</tt></a> provides no intrinsic means for the user to switch page. This is typically done through a <a href="QComboBox.html"><tt>QComboBox</tt></a> or a <a href="QListWidget.html"><tt>QListWidget</tt></a> that stores the titles of the <a href="QStackedLayout.html#QStackedLayout()"><tt>QStackedLayout</tt></a>'s pages. For example:</p> <pre> QComboBox *pageComboBox = new QComboBox; pageComboBox-&gt;addItem(tr(&quot;Page 1&quot;)); pageComboBox-&gt;addItem(tr(&quot;Page 2&quot;)); pageComboBox-&gt;addItem(tr(&quot;Page 3&quot;)); connect(pageComboBox, SIGNAL(activated(int)), stackedLayout, SLOT(setCurrentIndex(int)));</pre> <p>When populating a layout, the widgets are added to an internal list. The <a href="QLayout.html#indexOf(com.trolltech.qt.gui.QWidget)"><tt>indexOf</tt></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="QLayout.html#addWidget(com.trolltech.qt.gui.QWidget)"><tt>addWidget</tt></a> function, or inserted at a given index using the <a href="QStackedLayout.html#insertWidget(int, com.trolltech.qt.gui.QWidget)"><tt>insertWidget</tt></a> function. The <a href="QLayout.html#removeWidget(com.trolltech.qt.gui.QWidget)"><tt>removeWidget</tt></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()"><tt>count</tt></a> function.</p> <p>The <a href="QStackedLayout.html#widget(int)"><tt>widget</tt></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()"><tt>currentIndex</tt></a> and can be changed using <a href="QStackedLayout.html#setCurrentIndex(int)"><tt>setCurrentIndex</tt></a>. In a similar manner, the currently shown widget can be retrieved using the <a href="QStackedLayout.html#currentWidget()"><tt>currentWidget</tt></a> function, and altered using the <a href="QStackedLayout.html#setCurrentWidget(com.trolltech.qt.gui.QWidget)"><tt>setCurrentWidget</tt></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(int)"><tt>currentChanged</tt></a> and <a href="QStackedLayout.html#widgetRemoved(int)"><tt>widgetRemoved</tt></a> signals are emitted respectively.</p> @see <a href="QStackedWidget.html"><tt>QStackedWidget</tt></a> @see <a href="QTabWidget.html"><tt>QTabWidget</tt></a> */"> <signal name="protected final void currentChanged(int index)" doc="/** <p>This signal is emitted whenever the current widget in the layout changes. The <tt>index</tt> specifies the index of the new current widget.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(int index)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> <dl> <dt><b>See Also:</b></dt> <dd><a href="QStackedLayout.html#currentWidget()"><tt>currentWidget</tt></a>, <a href="QStackedLayout.html#setCurrentWidget(com.trolltech.qt.gui.QWidget)"><tt>setCurrentWidget</tt></a></dd> </dl> */"/> <signal name="protected final void widgetRemoved(int index)" doc="/** <p>This signal is emitted whenever a widget is removed from the layout. The widget's <tt>index</tt> is passed as parameter.</p> <dl> <dt><b>Compatible Slot Signatures:</b></dt> <dd><tt>void mySlot(int index)</tt></dd> <dd><tt>void mySlot()</tt></dd> </dl> <dl> <dt><b>See Also:</b></dt> <dd><a href="QLayout.html#removeWidget(com.trolltech.qt.gui.QWidget)"><tt>removeWidget</tt></a></dd> </dl> */"/> <method name="public QStackedLayout(com.trolltech.qt.gui.QWidget parent)" doc="/** <p>Constructs a new <a href="QStackedLayout.html#QStackedLayout()"><tt>QStackedLayout</tt></a> with the given <tt>parent</tt>.</p> <p>This layout will install itself on the <tt>parent</tt> widget and manage the geometry of its children.</p> */"/> <method name="public QStackedLayout(com.trolltech.qt.gui.QLayout parentLayout)" doc="/** <p>Constructs a new <a href="QStackedLayout.html#QStackedLayout()"><tt>QStackedLayout</tt></a> and inserts it into the given <tt>parentLayout</tt>.</p> */"/> <method name="public QStackedLayout()" doc="/** <p>Constructs a <a href="QStackedLayout.html#QStackedLayout()"><tt>QStackedLayout</tt></a> with no parent.</p> <p>This <a href="QStackedLayout.html#QStackedLayout()"><tt>QStackedLayout</tt></a> must be installed on a widget later on to become effective.</p> @see <a href="QLayout.html#addWidget(com.trolltech.qt.gui.QWidget)"><tt>addWidget</tt></a> @see <a href="QStackedLayout.html#insertWidget(int, com.trolltech.qt.gui.QWidget)"><tt>insertWidget</tt></a> */"/> <method name="public final int addStackedWidget(com.trolltech.qt.gui.QWidget w)" doc="/** <p>Adds the given <tt>w</tt> to the end of this layout and returns the index position of the <tt>w</tt>.</p> <p>If the <a href="QStackedLayout.html#QStackedLayout()"><tt>QStackedLayout</tt></a> is empty before this function is called, the given <tt>w</tt> becomes the current widget.</p> @see <a href="QStackedLayout.html#insertWidget(int, com.trolltech.qt.gui.QWidget)"><tt>insertWidget</tt></a> @see <a href="QLayout.html#removeWidget(com.trolltech.qt.gui.QWidget)"><tt>removeWidget</tt></a> @see <a href="QStackedLayout.html#setCurrentWidget(com.trolltech.qt.gui.QWidget)"><tt>setCurrentWidget</tt></a> */"/> <method name="public final int currentIndex()" doc="/** <p>Returns the index position of the widget that is visible.</p> <p>The current index is -1 if there is no current widget.</p> @see <a href="QStackedLayout.html#setCurrentIndex(int)"><tt>setCurrentIndex</tt></a> @see <a href="QStackedLayout.html#currentWidget()"><tt>currentWidget</tt></a> @see <a href="QLayout.html#indexOf(com.trolltech.qt.gui.QWidget)"><tt>indexOf</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QWidget currentWidget()" doc="/** <p>Returns the current widget, or 0 if there are no widgets in this layout.</p> @see <a href="QStackedLayout.html#currentIndex()"><tt>currentIndex</tt></a> @see <a href="QStackedLayout.html#setCurrentWidget(com.trolltech.qt.gui.QWidget)"><tt>setCurrentWidget</tt></a> */"/> <method name="public final int insertWidget(int index, com.trolltech.qt.gui.QWidget w)" doc="/** <p>Inserts the given <tt>w</tt> at the given <tt>index</tt> in this <a href="QStackedLayout.html#QStackedLayout()"><tt>QStackedLayout</tt></a>. If <tt>index</tt> is out of range, the widget is appended (in which case it is the actual index of the <tt>w</tt> that is returned).</p> <p>If the <a href="QStackedLayout.html#QStackedLayout()"><tt>QStackedLayout</tt></a> is empty before this function is called, the given <tt>w</tt> 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> @see <a href="QLayout.html#addWidget(com.trolltech.qt.gui.QWidget)"><tt>addWidget</tt></a> @see <a href="QLayout.html#removeWidget(com.trolltech.qt.gui.QWidget)"><tt>removeWidget</tt></a> @see <a href="QStackedLayout.html#setCurrentWidget(com.trolltech.qt.gui.QWidget)"><tt>setCurrentWidget</tt></a> */"/> <method name="public final void setCurrentIndex(int index)" doc="/** <p>Sets the index position of the widget that is visible to <tt>index</tt>.</p> <p>The current index is -1 if there is no current widget.</p> @see <a href="QStackedLayout.html#currentIndex()"><tt>currentIndex</tt></a> @see <a href="QStackedLayout.html#currentWidget()"><tt>currentWidget</tt></a> @see <a href="QLayout.html#indexOf(com.trolltech.qt.gui.QWidget)"><tt>indexOf</tt></a> */"/> <method name="public final void setCurrentWidget(com.trolltech.qt.gui.QWidget w)" doc="/** <p>Sets the current widget to be the specified <tt>w</tt>. The new current widget must already be contained in this stacked layout.</p> @see <a href="QStackedLayout.html#setCurrentIndex(int)"><tt>setCurrentIndex</tt></a> @see <a href="QStackedLayout.html#currentWidget()"><tt>currentWidget</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QWidget widget(int arg__1)" doc="/** <p>Returns the widget at the given <tt>arg__1</tt>, or 0 if there is no widget at the given position.</p> @see <a href="QStackedLayout.html#currentWidget()"><tt>currentWidget</tt></a> @see <a href="QLayout.html#indexOf(com.trolltech.qt.gui.QWidget)"><tt>indexOf</tt></a> */"/> <method name="public void addItem(com.trolltech.qt.gui.QLayoutItemInterface item)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="public int count()" doc="/** <p>Returns the number of widgets contained in the layout.</p> @see <a href="QStackedLayout.html#currentIndex()"><tt>currentIndex</tt></a> @see <a href="QStackedLayout.html#widget(int)"><tt>widget</tt></a> */"/> <method name="public com.trolltech.qt.gui.QLayoutItemInterface itemAt(int arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="public com.trolltech.qt.core.QSize minimumSize()" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="public void setGeometry(com.trolltech.qt.core.QRect rect)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="public com.trolltech.qt.core.QSize sizeHint()" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="public com.trolltech.qt.gui.QLayoutItemInterface takeAt(int arg__1)" doc="/** <p>This function is reimplemented for internal reasons.</p> */"/> <method name="public com.trolltech.qt.gui.QWidget widget()"/> </class>