1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qwidgetstack.cpp:97 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>QWidgetStack Class</title>
|
---|
7 | <style type="text/css"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { background: #ffffff; color: black; }
|
---|
12 | --></style>
|
---|
13 | </head>
|
---|
14 | <body>
|
---|
15 |
|
---|
16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
17 | <tr bgcolor="#E5E5E5">
|
---|
18 | <td valign=center>
|
---|
19 | <a href="index.html">
|
---|
20 | <font color="#004faf">Home</font></a>
|
---|
21 | | <a href="classes.html">
|
---|
22 | <font color="#004faf">All Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main Classes</font></a>
|
---|
25 | | <a href="annotated.html">
|
---|
26 | <font color="#004faf">Annotated</font></a>
|
---|
27 | | <a href="groups.html">
|
---|
28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
29 | | <a href="functions.html">
|
---|
30 | <font color="#004faf">Functions</font></a>
|
---|
31 | </td>
|
---|
32 | <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>
|
---|
33 |
|
---|
34 | <p>The QWidgetStack class provides a stack of widgets of which
|
---|
35 | only the top widget is user-visible.
|
---|
36 | <a href="#details">More...</a>
|
---|
37 | <p><tt>#include <<a href="qwidgetstack-h.html">qwidgetstack.h</a>></tt>
|
---|
38 | <p>Inherits <a href="qframe.html">QFrame</a>.
|
---|
39 | <p><a href="qwidgetstack-members.html">List of all member functions.</a>
|
---|
40 | <h2>Public Members</h2>
|
---|
41 | <ul>
|
---|
42 | <li class=fn><a href="#QWidgetStack"><b>QWidgetStack</b></a> ( QWidget * parent = 0, const char * name = 0 )</li>
|
---|
43 | <li class=fn><a href="#QWidgetStack-2"><b>QWidgetStack</b></a> ( QWidget * parent, const char * name, WFlags f )</li>
|
---|
44 | <li class=fn><a href="#~QWidgetStack"><b>~QWidgetStack</b></a> ()</li>
|
---|
45 | <li class=fn>int <a href="#addWidget"><b>addWidget</b></a> ( QWidget * w, int id = -1 )</li>
|
---|
46 | <li class=fn>void <a href="#removeWidget"><b>removeWidget</b></a> ( QWidget * w )</li>
|
---|
47 | <li class=fn>QWidget * <a href="#widget"><b>widget</b></a> ( int id ) const</li>
|
---|
48 | <li class=fn>int <a href="#id"><b>id</b></a> ( QWidget * widget ) const</li>
|
---|
49 | <li class=fn>QWidget * <a href="#visibleWidget"><b>visibleWidget</b></a> () const</li>
|
---|
50 | </ul>
|
---|
51 | <h2>Public Slots</h2>
|
---|
52 | <ul>
|
---|
53 | <li class=fn>void <a href="#raiseWidget"><b>raiseWidget</b></a> ( int id )</li>
|
---|
54 | <li class=fn>void <a href="#raiseWidget-2"><b>raiseWidget</b></a> ( QWidget * w )</li>
|
---|
55 | </ul>
|
---|
56 | <h2>Signals</h2>
|
---|
57 | <ul>
|
---|
58 | <li class=fn>void <a href="#aboutToShow"><b>aboutToShow</b></a> ( int )</li>
|
---|
59 | <li class=fn>void <a href="#aboutToShow-2"><b>aboutToShow</b></a> ( QWidget * )</li>
|
---|
60 | </ul>
|
---|
61 | <h2>Protected Members</h2>
|
---|
62 | <ul>
|
---|
63 | <li class=fn>virtual void <a href="#setChildGeometries"><b>setChildGeometries</b></a> ()</li>
|
---|
64 | </ul>
|
---|
65 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
66 |
|
---|
67 |
|
---|
68 | The QWidgetStack class provides a stack of widgets of which
|
---|
69 | only the top widget is user-visible.
|
---|
70 | <p>
|
---|
71 |
|
---|
72 | <p> The application programmer can move any widget to the top of the
|
---|
73 | stack at any time using <a href="#raiseWidget">raiseWidget</a>(), and add or remove widgets
|
---|
74 | using <a href="#addWidget">addWidget</a>() and <a href="#removeWidget">removeWidget</a>(). It is not sufficient to pass
|
---|
75 | the widget stack as parent to a widget which should be inserted into
|
---|
76 | the widgetstack.
|
---|
77 | <p> <a href="#visibleWidget">visibleWidget</a>() is the <em>get</em> equivalent of raiseWidget(); it
|
---|
78 | returns a pointer to the widget that is currently at the top of
|
---|
79 | the stack.
|
---|
80 | <p> QWidgetStack also provides the ability to manipulate widgets
|
---|
81 | through application-specified integer IDs. You can also translate
|
---|
82 | from widget pointers to IDs using <a href="#id">id</a>() and from IDs to widget
|
---|
83 | pointers using <a href="#widget">widget</a>(). These numeric IDs are unique (per
|
---|
84 | QWidgetStack, not globally), but QWidgetStack does not attach any
|
---|
85 | additional meaning to them.
|
---|
86 | <p> The default widget stack is frameless, but you can use the usual
|
---|
87 | <a href="qframe.html">QFrame</a> functions (such as <a href="qframe.html#setFrameStyle">setFrameStyle</a>()) to add a frame.
|
---|
88 | <p> QWidgetStack provides a signal, <a href="#aboutToShow">aboutToShow</a>(), which is emitted
|
---|
89 | just before a managed widget is shown.
|
---|
90 | <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>.
|
---|
91 |
|
---|
92 | <hr><h2>Member Function Documentation</h2>
|
---|
93 | <h3 class=fn><a name="QWidgetStack"></a>QWidgetStack::QWidgetStack ( <a href="qwidget.html">QWidget</a> * parent = 0, const char * name = 0 )
|
---|
94 | </h3>
|
---|
95 | Constructs an empty widget stack.
|
---|
96 | <p> The <em>parent</em> and <em>name</em> arguments are passed to the <a href="qframe.html">QFrame</a>
|
---|
97 | constructor.
|
---|
98 |
|
---|
99 | <h3 class=fn><a name="QWidgetStack-2"></a>QWidgetStack::QWidgetStack ( <a href="qwidget.html">QWidget</a> * parent, const char * name, WFlags f )
|
---|
100 | </h3>
|
---|
101 | Constructs an empty widget stack.
|
---|
102 | <p> The <em>parent</em>, <em>name</em> and <em>f</em> arguments are passed to the <a href="qframe.html">QFrame</a>
|
---|
103 | constructor.
|
---|
104 |
|
---|
105 | <h3 class=fn><a name="~QWidgetStack"></a>QWidgetStack::~QWidgetStack ()
|
---|
106 | </h3>
|
---|
107 | Destroys the object and frees any allocated resources.
|
---|
108 |
|
---|
109 | <h3 class=fn>void <a name="aboutToShow"></a>QWidgetStack::aboutToShow ( int )<tt> [signal]</tt>
|
---|
110 | </h3>
|
---|
111 |
|
---|
112 | <p> This signal is emitted just before a managed widget is shown if
|
---|
113 | that managed widget has an ID != -1. The argument is the numeric
|
---|
114 | ID of the widget.
|
---|
115 | <p> If you call <a href="#visibleWidget">visibleWidget</a>() in a slot connected to <a href="#aboutToShow">aboutToShow</a>(),
|
---|
116 | the widget it returns is the one that is currently visible, not
|
---|
117 | the one that is about to be shown.
|
---|
118 |
|
---|
119 | <h3 class=fn>void <a name="aboutToShow-2"></a>QWidgetStack::aboutToShow ( <a href="qwidget.html">QWidget</a> * )<tt> [signal]</tt>
|
---|
120 | </h3>
|
---|
121 |
|
---|
122 | <p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
123 | <p> This signal is emitted just before a managed widget is shown. The
|
---|
124 | argument is a pointer to the widget.
|
---|
125 | <p> If you call <a href="#visibleWidget">visibleWidget</a>() in a slot connected to <a href="#aboutToShow">aboutToShow</a>(),
|
---|
126 | the widget returned is the one that is currently visible, not the
|
---|
127 | one that is about to be shown.
|
---|
128 |
|
---|
129 | <h3 class=fn>int <a name="addWidget"></a>QWidgetStack::addWidget ( <a href="qwidget.html">QWidget</a> * w, int id = -1 )
|
---|
130 | </h3>
|
---|
131 | Adds widget <em>w</em> to this stack of widgets, with ID <em>id</em>.
|
---|
132 | <p> If you pass an id >= 0 this ID is used. If you pass an <em>id</em> of
|
---|
133 | -1 (the default), the widgets will be numbered automatically. If
|
---|
134 | you pass -2 a unique negative integer will be generated. No widget
|
---|
135 | has an ID of -1. Returns the ID or -1 on failure (e.g. <em>w</em> is 0).
|
---|
136 | <p> If you pass an id that is already used, then a unique negative
|
---|
137 | integer will be generated to prevent two widgets having the same
|
---|
138 | id.
|
---|
139 | <p> If <em>w</em> already exists in the stack the widget will be removed first.
|
---|
140 | <p> If <em>w</em> is not a child of this QWidgetStack moves it using
|
---|
141 | <a href="qwidget.html#reparent">reparent</a>().
|
---|
142 |
|
---|
143 | <p>Example: <a href="xform-example.html#x1276">xform/xform.cpp</a>.
|
---|
144 | <h3 class=fn>int <a name="id"></a>QWidgetStack::id ( <a href="qwidget.html">QWidget</a> * widget ) const
|
---|
145 | </h3>
|
---|
146 | Returns the ID of the <em>widget</em>. Returns -1 if <em>widget</em> is 0 or
|
---|
147 | is not being managed by this widget stack.
|
---|
148 | <p> <p>See also <a href="#widget">widget</a>() and <a href="#addWidget">addWidget</a>().
|
---|
149 |
|
---|
150 | <h3 class=fn>void <a name="raiseWidget"></a>QWidgetStack::raiseWidget ( int id )<tt> [slot]</tt>
|
---|
151 | </h3>
|
---|
152 | Raises the widget with ID <em>id</em> to the top of the widget stack.
|
---|
153 | <p> <p>See also <a href="#visibleWidget">visibleWidget</a>().
|
---|
154 |
|
---|
155 | <p>Example: <a href="xform-example.html#x1277">xform/xform.cpp</a>.
|
---|
156 | <h3 class=fn>void <a name="raiseWidget-2"></a>QWidgetStack::raiseWidget ( <a href="qwidget.html">QWidget</a> * w )<tt> [slot]</tt>
|
---|
157 | </h3>
|
---|
158 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
159 | <p> Raises widget <em>w</em> to the top of the widget stack.
|
---|
160 |
|
---|
161 | <h3 class=fn>void <a name="removeWidget"></a>QWidgetStack::removeWidget ( <a href="qwidget.html">QWidget</a> * w )
|
---|
162 | </h3>
|
---|
163 | 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
|
---|
164 | substituted.
|
---|
165 | <p> <p>See also <a href="#visibleWidget">visibleWidget</a>() and <a href="#raiseWidget">raiseWidget</a>().
|
---|
166 |
|
---|
167 | <h3 class=fn>void <a name="setChildGeometries"></a>QWidgetStack::setChildGeometries ()<tt> [virtual protected]</tt>
|
---|
168 | </h3>
|
---|
169 | Fixes up the children's geometries.
|
---|
170 |
|
---|
171 | <h3 class=fn><a href="qwidget.html">QWidget</a> * <a name="visibleWidget"></a>QWidgetStack::visibleWidget () const
|
---|
172 | </h3>
|
---|
173 | Returns the currently visible widget (the one at the top of the
|
---|
174 | stack), or 0 if nothing is currently being shown.
|
---|
175 | <p> <p>See also <a href="#aboutToShow">aboutToShow</a>(), <a href="#id">id</a>(), and <a href="#raiseWidget">raiseWidget</a>().
|
---|
176 |
|
---|
177 | <h3 class=fn><a href="qwidget.html">QWidget</a> * <a name="widget"></a>QWidgetStack::widget ( int id ) const
|
---|
178 | </h3>
|
---|
179 | Returns the widget with ID <em>id</em>. Returns 0 if this widget stack
|
---|
180 | does not manage a widget with ID <em>id</em>.
|
---|
181 | <p> <p>See also <a href="#id">id</a>() and <a href="#addWidget">addWidget</a>().
|
---|
182 |
|
---|
183 | <!-- eof -->
|
---|
184 | <hr><p>
|
---|
185 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
186 | Copyright © 1995-2007
|
---|
187 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
188 | <table width=100% cellspacing=0 border=0><tr>
|
---|
189 | <td>Copyright © 2007
|
---|
190 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
191 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
192 | </table></div></address></body>
|
---|
193 | </html>
|
---|