<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/widgets/qwidgetstack.cpp:63 --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>QWidgetStack Class</title> <style type="text/css"><!-- h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } body { background: #ffffff; color: black; } --></style> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr bgcolor="#E5E5E5"> <td valign=center> <a href="index.html"> <font color="#004faf">Home</font></a> | <a href="classes.html"> <font color="#004faf">All Classes</font></a> | <a href="mainclasses.html"> <font color="#004faf">Main Classes</font></a> | <a href="annotated.html"> <font color="#004faf">Annotated</font></a> | <a href="groups.html"> <font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"> <font color="#004faf">Functions</font></a> </td> <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QWidgetStack Class Reference</h1> <p>The QWidgetStack class provides a stack of widgets of which only the top widget is user-visible. <a href="#details">More...</a> <p><tt>#include <<a href="qwidgetstack-h.html">qwidgetstack.h</a>></tt> <p>Inherits <a href="qframe.html">QFrame</a>. <p><a href="qwidgetstack-members.html">List of all member functions.</a> <h2>Public Members</h2> <ul> <li><div class=fn><a href="#QWidgetStack"><b>QWidgetStack</b></a> ( QWidget * parent = 0, const char * name = 0 )</div></li> <li><div class=fn><a href="#~QWidgetStack"><b>~QWidgetStack</b></a> ()</div></li> <li><div class=fn>int <a href="#addWidget"><b>addWidget</b></a> ( QWidget * w, int id = -1 )</div></li> <li><div class=fn>void <a href="#removeWidget"><b>removeWidget</b></a> ( QWidget * w )</div></li> <li><div class=fn>QWidget * <a href="#widget"><b>widget</b></a> ( int id ) const</div></li> <li><div class=fn>int <a href="#id"><b>id</b></a> ( QWidget * widget ) const</div></li> <li><div class=fn>QWidget * <a href="#visibleWidget"><b>visibleWidget</b></a> () const</div></li> </ul> <h2>Public Slots</h2> <ul> <li><div class=fn>void <a href="#raiseWidget"><b>raiseWidget</b></a> ( int id )</div></li> <li><div class=fn>void <a href="#raiseWidget-2"><b>raiseWidget</b></a> ( QWidget * w )</div></li> </ul> <h2>Signals</h2> <ul> <li><div class=fn>void <a href="#aboutToShow"><b>aboutToShow</b></a> ( int )</div></li> <li><div class=fn>void <a href="#aboutToShow-2"><b>aboutToShow</b></a> ( QWidget * )</div></li> </ul> <h2>Protected Members</h2> <ul> <li><div class=fn>virtual void <a href="#setChildGeometries"><b>setChildGeometries</b></a> ()</div></li> </ul> <hr><a name="details"></a><h2>Detailed Description</h2> <p> The QWidgetStack class provides a stack of widgets of which only the top widget is user-visible. <p> <p> The application programmer can move any widget to the top of the stack at any time using <a href="#raiseWidget">raiseWidget</a>(), and add or remove widgets using <a href="#addWidget">addWidget</a>() and <a href="#removeWidget">removeWidget</a>(). <p> <a href="#visibleWidget">visibleWidget</a>() is the <em>get</em> equivalent of raiseWidget(); it returns a pointer to the widget that is currently at the top of the stack. <p> QWidgetStack also provides the ability to manipulate widgets through application-specified integer ids. You can also translate from widget pointers to ids using <a href="#id">id</a>() and from ids to widget pointers using <a href="#widget">widget</a>(). These numeric ids are unique (per QWidgetStack, not globally), but QWidgetStack does not attach any additional meaning to them. <p> The default widget stack is frameless, but you can use the usual <a href="qframe.html">QFrame</a> functions (such as <a href="qframe.html#setFrameStyle">setFrameStyle</a>()) to add a frame. <p> QWidgetStack provides a signal, <a href="#aboutToShow">aboutToShow</a>(), which is emitted just before a managed widget is shown. <p> <p>See also <a href="qtabdialog.html">QTabDialog</a>, <a href="qtabbar.html">QTabBar</a>, <a href="qframe.html">QFrame</a> and <a href="organizers.html">Organizers</a>. <hr><h2>Member Function Documentation</h2> <h3 class=fn><a name="QWidgetStack"></a>QWidgetStack::QWidgetStack ( <a href="qwidget.html">QWidget</a> * parent = 0, const char * name = 0 ) </h3> Constructs an empty widget stack with parent <em>parent</em> and called <em>name</em>. <h3 class=fn><a name="~QWidgetStack"></a>QWidgetStack::~QWidgetStack () </h3> Destroys the object and frees any allocated resources. <h3 class=fn>void <a name="aboutToShow"></a>QWidgetStack::aboutToShow ( int )<tt> [signal]</tt> </h3> <p> This signal is emitted just before a managed widget is shown if that managed widget has an id != -1. The argument is the numeric id of the widget. <h3 class=fn>void <a name="aboutToShow-2"></a>QWidgetStack::aboutToShow ( <a href="qwidget.html">QWidget</a> * )<tt> [signal]</tt> </h3> This is an overloaded member function, provided for convenience. It behaves essentially like the above function. <p> This signal is emitted just before a managed widget is shown. The argument is a pointer to the widget. <h3 class=fn>int <a name="addWidget"></a>QWidgetStack::addWidget ( <a href="qwidget.html">QWidget</a> * w, int id = -1 ) </h3> Adds widget <em>w</em> to this stack of widgets, with id <em>id</em>. <p> If you pass an id >= 0 this id is used. If you pass an <em>id</em> of -1 (the default), the widgets will be numbered automatically. If you pass -2 a unique negative integer will be generated. No widget has an id of -1. <p> If <em>w</em> is not a child of this QWidgetStack moves it using <a href="qwidget.html#reparent">reparent</a>(). <p>Example: <a href="xform-example.html#x132">xform/xform.cpp</a>. <h3 class=fn>int <a name="id"></a>QWidgetStack::id ( <a href="qwidget.html">QWidget</a> * widget ) const </h3> Returns the id of the <em>widget</em>. If <em>widget</em> is 0 or is not being managed by this widget stack, this function returns -1. <p> <p>See also <a href="#widget">widget</a>() and <a href="#addWidget">addWidget</a>(). <h3 class=fn>void <a name="raiseWidget"></a>QWidgetStack::raiseWidget ( int id )<tt> [slot]</tt> </h3> Raises the widget with id, <em>id</em>, to the top of the widget stack. <p> <p>See also <a href="#visibleWidget">visibleWidget</a>(). <p>Example: <a href="xform-example.html#x133">xform/xform.cpp</a>. <h3 class=fn>void <a name="raiseWidget-2"></a>QWidgetStack::raiseWidget ( <a href="qwidget.html">QWidget</a> * w )<tt> [slot]</tt> </h3> This is an overloaded member function, provided for convenience. It behaves essentially like the above function. <p> Raises widget <em>w</em> to the top of the widget stack. <h3 class=fn>void <a name="removeWidget"></a>QWidgetStack::removeWidget ( <a href="qwidget.html">QWidget</a> * w ) </h3> Removes widget <em>w</em> from this stack of widgets. Does not delete <em>w</em>. If <em>w</em> is the currently visible widget, no other widget is substituted. pareent <p>See also <a href="#visibleWidget">visibleWidget</a>() and <a href="#raiseWidget">raiseWidget</a>(). <h3 class=fn>void <a name="setChildGeometries"></a>QWidgetStack::setChildGeometries ()<tt> [virtual protected]</tt> </h3> Fixes up the children's geometries. <h3 class=fn><a href="qwidget.html">QWidget</a> * <a name="visibleWidget"></a>QWidgetStack::visibleWidget () const </h3> Returns a pointer to the currently visible widget (the one at the top of the stack), or 0 if nothing is currently being shown. <p> <p>See also <a href="#aboutToShow">aboutToShow</a>(), <a href="#id">id</a>() and <a href="#raiseWidget">raiseWidget</a>(). <h3 class=fn><a href="qwidget.html">QWidget</a> * <a name="widget"></a>QWidgetStack::widget ( int id ) const </h3> Returns a pointer to the widget with id <em>id</em>. If this widget stack does not manage a widget with id <em>id</em>, this function returns 0. <p> <p>See also <a href="#id">id</a>() and <a href="#addWidget">addWidget</a>(). <!-- eof --> <hr><p> This file is part of the <a href="index.html">Qt toolkit</a>. Copyright © 1995-2001 <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center> <table width=100% cellspacing=0 border=0><tr> <td>Copyright © 2001 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a> <td align=right><div align=right>Qt version 3.0.2</div> </table></div></address></body> </html>