QWidgetStack(3qt)

NAME
QWidgetStack - Stack of widgets of which only the top widget is user-visible

SYNOPSIS
#include <qwidgetstack.h>

Inherits QFrame.

  Public Members
QWidgetStack ( QWidget * parent = 0, const char * name = 0 )
~QWidgetStack ()
int addWidget ( QWidget * w, int id = -1 )
void removeWidget ( QWidget * w )
QWidget * widget ( int id ) const
int id ( QWidget * widget ) const
QWidget * visibleWidget () const

  Public Slots
void raiseWidget ( int id )
void raiseWidget ( QWidget * w )

  Signals
void aboutToShow ( int )
void aboutToShow ( QWidget * )

  Protected Members
virtual void setChildGeometries ()

DESCRIPTION
The QWidgetStack class provides a stack of widgets of which only the top widget is user-visible.

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().

visibleWidget() is the get equivalent of raiseWidget(); it returns a pointer to the widget that is currently at the top of the stack.

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.

The default widget stack is frameless, but you can use the usual QFrame functions (such as setFrameStyle()) to add a frame.

QWidgetStack provides a signal, aboutToShow(), which is emitted just before a managed widget is shown.

See also QTabDialog, QTabBar, QFrame and Organizers.

MEMBER FUNCTION DOCUMENTATION

QWidgetStack::QWidgetStack ( QWidget * parent = 0, const char * name = 0 )
Constructs an empty widget stack with parent parent and called name.

QWidgetStack::~QWidgetStack ()
Destroys the object and frees any allocated resources.

void QWidgetStack::aboutToShow ( int ) [signal]
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.

void QWidgetStack::aboutToShow ( QWidget * ) [signal]
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

This signal is emitted just before a managed widget is shown. The argument is a pointer to the widget.

int QWidgetStack::addWidget ( QWidget * w, int id = -1 )
Adds widget w to this stack of widgets, with id id.

If you pass an id >= 0 this id is used. If you pass an id 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.

If w is not a child of this QWidgetStack moves it using reparent().

Example: xform/xform.cpp.

int QWidgetStack::id ( QWidget * widget ) const
Returns the id of the widget. If widget is 0 or is not being managed by this widget stack, this function returns -1.

See also widget() and addWidget().

void QWidgetStack::raiseWidget ( int id ) [slot]
Raises the widget with id, id, to the top of the widget stack.

See also visibleWidget().

Example: xform/xform.cpp.

void QWidgetStack::raiseWidget ( QWidget * w ) [slot]
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Raises widget w to the top of the widget stack.

void QWidgetStack::removeWidget ( QWidget * w )
Removes widget w from this stack of widgets. Does not delete w. If w is the currently visible widget, no other widget is substituted. pareent

See also visibleWidget() and raiseWidget().

void QWidgetStack::setChildGeometries () [virtual protected]
Fixes up the children's geometries.

QWidget * QWidgetStack::visibleWidget () const
Returns a pointer to the currently visible widget (the one at the top of the stack), or 0 if nothing is currently being shown.

See also aboutToShow(), id() and raiseWidget().

QWidget * QWidgetStack::widget ( int id ) const
Returns a pointer to the widget with id id. If this widget stack does not manage a widget with id id, this function returns 0.

See also id() and addWidget().

SEE ALSO
http://doc.trolltech.com/qwidgetstack.html http://www.trolltech.com/faq/tech.html

COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.

AUTHOR
Generated automatically from the source code.

BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you.

The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech.

If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qwidgetstack.3qt) and the Qt version (3.0.3).