1QWidgetStack(3qt)                                            QWidgetStack(3qt)
2
3
4

NAME

6       QWidgetStack - Stack of widgets of which only the top widget is user-
7       visible
8

SYNOPSIS

10       #include <qwidgetstack.h>
11
12       Inherits QFrame.
13
14   Public Members
15       QWidgetStack ( QWidget * parent = 0, const char * name = 0 )
16       QWidgetStack ( QWidget * parent, const char * name, WFlags f )
17       ~QWidgetStack ()
18       int addWidget ( QWidget * w, int id = -1 )
19       void removeWidget ( QWidget * w )
20       QWidget * widget ( int id ) const
21       int id ( QWidget * widget ) const
22       QWidget * visibleWidget () const
23
24   Public Slots
25       void raiseWidget ( int id )
26       void raiseWidget ( QWidget * w )
27
28   Signals
29       void aboutToShow ( int )
30       void aboutToShow ( QWidget * )
31
32   Protected Members
33       virtual void setChildGeometries ()
34

DESCRIPTION

36       The QWidgetStack class provides a stack of widgets of which only the
37       top widget is user-visible.
38
39       The application programmer can move any widget to the top of the stack
40       at any time using raiseWidget(), and add or remove widgets using
41       addWidget() and removeWidget(). It is not sufficient to pass the widget
42       stack as parent to a widget which should be inserted into the
43       widgetstack.
44
45       visibleWidget() is the get equivalent of raiseWidget(); it returns a
46       pointer to the widget that is currently at the top of the stack.
47
48       QWidgetStack also provides the ability to manipulate widgets through
49       application-specified integer IDs. You can also translate from widget
50       pointers to IDs using id() and from IDs to widget pointers using
51       widget(). These numeric IDs are unique (per QWidgetStack, not
52       globally), but QWidgetStack does not attach any additional meaning to
53       them.
54
55       The default widget stack is frameless, but you can use the usual QFrame
56       functions (such as setFrameStyle()) to add a frame.
57
58       QWidgetStack provides a signal, aboutToShow(), which is emitted just
59       before a managed widget is shown.
60
61       See also QTabDialog, QTabBar, QFrame, and Organizers.
62

MEMBER FUNCTION DOCUMENTATION

QWidgetStack::QWidgetStack ( QWidget * parent = 0, const char * name = 0 )

65       Constructs an empty widget stack.
66
67       The parent and name arguments are passed to the QFrame constructor.
68

QWidgetStack::QWidgetStack ( QWidget * parent, const char * name, WFlags f )

70       Constructs an empty widget stack.
71
72       The parent, name and f arguments are passed to the QFrame constructor.
73

QWidgetStack::~QWidgetStack ()

75       Destroys the object and frees any allocated resources.
76

void QWidgetStack::aboutToShow ( int ) [signal]

78       This signal is emitted just before a managed widget is shown if that
79       managed widget has an ID != -1. The argument is the numeric ID of the
80       widget.
81
82       If you call visibleWidget() in a slot connected to aboutToShow(), the
83       widget it returns is the one that is currently visible, not the one
84       that is about to be shown.
85

void QWidgetStack::aboutToShow ( QWidget * ) [signal]

87       This is an overloaded member function, provided for convenience. It
88       behaves essentially like the above function.
89
90       This signal is emitted just before a managed widget is shown. The
91       argument is a pointer to the widget.
92
93       If you call visibleWidget() in a slot connected to aboutToShow(), the
94       widget returned is the one that is currently visible, not the one that
95       is about to be shown.
96

int QWidgetStack::addWidget ( QWidget * w, int id = -1 )

98       Adds widget w to this stack of widgets, with ID id.
99
100       If you pass an id >= 0 this ID is used. If you pass an id of -1 (the
101       default), the widgets will be numbered automatically. If you pass -2 a
102       unique negative integer will be generated. No widget has an ID of -1.
103       Returns the ID or -1 on failure (e.g. w is 0).
104
105       If you pass an id that is already used, then a unique negative integer
106       will be generated to prevent two widgets having the same id.
107
108       If w already exists in the stack the widget will be removed first.
109
110       If w is not a child of this QWidgetStack moves it using reparent().
111
112       Example: xform/xform.cpp.
113

int QWidgetStack::id ( QWidget * widget ) const

115       Returns the ID of the widget. Returns -1 if widget is 0 or is not being
116       managed by this widget stack.
117
118       See also widget() and addWidget().
119

void QWidgetStack::raiseWidget ( int id ) [slot]

121       Raises the widget with ID id to the top of the widget stack.
122
123       See also visibleWidget().
124
125       Example: xform/xform.cpp.
126

void QWidgetStack::raiseWidget ( QWidget * w ) [slot]

128       This is an overloaded member function, provided for convenience. It
129       behaves essentially like the above function.
130
131       Raises widget w to the top of the widget stack.
132

void QWidgetStack::removeWidget ( QWidget * w )

134       Removes widget w from this stack of widgets. Does not delete w. If w is
135       the currently visible widget, no other widget is substituted.
136
137       See also visibleWidget() and raiseWidget().
138

void QWidgetStack::setChildGeometries () [virtual protected]

140       Fixes up the children's geometries.
141

QWidget * QWidgetStack::visibleWidget () const

143       Returns the currently visible widget (the one at the top of the stack),
144       or 0 if nothing is currently being shown.
145
146       See also aboutToShow(), id(), and raiseWidget().
147

QWidget * QWidgetStack::widget ( int id ) const

149       Returns the widget with ID id. Returns 0 if this widget stack does not
150       manage a widget with ID id.
151
152       See also id() and addWidget().
153
154

SEE ALSO

156       http://doc.trolltech.com/qwidgetstack.html
157       http://www.trolltech.com/faq/tech.html
158
160       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
161       license file included in the distribution for a complete license
162       statement.
163

AUTHOR

165       Generated automatically from the source code.
166

BUGS

168       If you find a bug in Qt, please report it as described in
169       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
170       help you. Thank you.
171
172       The definitive Qt documentation is provided in HTML format; it is
173       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
174       web browser. This man page is provided as a convenience for those users
175       who prefer man pages, although this format is not officially supported
176       by Trolltech.
177
178       If you find errors in this manual page, please report them to qt-
179       bugs@trolltech.com.  Please include the name of the manual page
180       (qwidgetstack.3qt) and the Qt version (3.3.8).
181
182
183
184Trolltech AS                    2 February 2007              QWidgetStack(3qt)
Impressum