.BI "int \fBaddWidget\fR ( QWidget * w, int id = -1 )"
.br
.ti -1c
.BI "void \fBremoveWidget\fR ( QWidget * w )"
.br
.ti -1c
.BI "QWidget * \fBwidget\fR ( int id ) const"
.br
.ti -1c
.BI "int \fBid\fR ( QWidget * widget ) const"
.br
.ti -1c
.BI "QWidget * \fBvisibleWidget\fR () const"
.br
.in -1c
.SS "Public Slots"
.in +1c
.ti -1c
.BI "void \fBraiseWidget\fR ( int id )"
.br
.ti -1c
.BI "void \fBraiseWidget\fR ( QWidget * w )"
.br
.in -1c
.SS "Signals"
.in +1c
.ti -1c
.BI "void \fBaboutToShow\fR ( int )"
.br
.ti -1c
.BI "void \fBaboutToShow\fR ( QWidget * )"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "virtual void \fBsetChildGeometries\fR ()"
.br
.in -1c
.SH DESCRIPTION
The QWidgetStack class provides a stack of widgets of which only the top widget is user-visible.
.PP
The application programmer can move any widget to the top of the stack at any time using raiseWidget(), and add or remove widgets using addWidget() and removeWidget(). It is not sufficient to pass the widget stack as parent to a widget which should be inserted into the widgetstack.
.PP
visibleWidget() is the \fIget\fR equivalent of raiseWidget(); it returns a pointer to the widget that is currently at the top of the stack.
.PP
QWidgetStack also provides the ability to manipulate widgets through application-specified integer IDs. You can also translate from widget pointers to IDs using id() and from IDs to widget pointers using widget(). These numeric IDs are unique (per QWidgetStack, not globally), but QWidgetStack does not attach any additional meaning to them.
.PP
The default widget stack is frameless, but you can use the usual QFrame functions (such as setFrameStyle()) to add a frame.
.PP
QWidgetStack provides a signal, aboutToShow(), which is emitted just before a managed widget is shown.
.PP
See also QTabDialog, QTabBar, QFrame, and Organizers.
The \fIparent\fR, \fIname\fR and \fIf\fR arguments are passed to the QFrame constructor.
.SH "QWidgetStack::~QWidgetStack ()"
Destroys the object and frees any allocated resources.
.SH "void QWidgetStack::aboutToShow ( int )\fC [signal]\fR"
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.
.PP
If you call visibleWidget() in a slot connected to aboutToShow(), the widget it returns is the one that is currently visible, not the one that is about to be shown.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
This signal is emitted just before a managed widget is shown. The argument is a pointer to the widget.
.PP
If you call visibleWidget() in a slot connected to aboutToShow(), the widget returned is the one that is currently visible, not the one that is about to be shown.
.SH "int QWidgetStack::addWidget ( QWidget * w, int id = -1 )"
Adds widget \fIw\fR to this stack of widgets, with ID \fIid\fR.
.PP
If you pass an id >= 0 this ID is used. If you pass an \fIid\fR 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. Returns the ID or -1 on failure (e.g. \fIw\fR is 0).
.PP
If you pass an id that is already used, then a unique negative integer will be generated to prevent two widgets having the same id.
.PP
If \fIw\fR already exists in the stack the widget will be removed first.
.PP
If \fIw\fR is not a child of this QWidgetStack moves it using reparent().
Returns the ID of the \fIwidget\fR. Returns -1 if \fIwidget\fR is 0 or is not being managed by this widget stack.
.PP
See also widget() and addWidget().
.SH "void QWidgetStack::raiseWidget ( int id )\fC [slot]\fR"
Raises the widget with ID \fIid\fR to the top of the widget stack.
.PP
See also visibleWidget().
.PP
Example: xform/xform.cpp.
.SH "void QWidgetStack::raiseWidget ( QWidget * w )\fC [slot]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Raises widget \fIw\fR to the top of the widget stack.
.SH "void QWidgetStack::removeWidget ( QWidget * w )"
Removes widget \fIw\fR from this stack of widgets. Does not delete \fIw\fR. If \fIw\fR is the currently visible widget, no other widget is substituted.