QWidgetStack(3qt)

NAME
QWidgetStack - Stack of widgets, where the user can see only the top widget

#include <qwidgetstack.h>

Inherits QFrame.

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

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

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

  Protected Members
virtual void setChildGeometries ()

DESCRIPTION
The QWidgetStack class provides a stack of widgets, where the user can see only the top widget.

The application programmer can move any widget to the top of the stack at any time using the slot 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 on the top of the stack.

QWidgetStack also provides the ability to manipulate widgets through application-specfied integer IDs, and to translate from widget pointers to IDs using id() and from IDs to widget pointers using widget(). These numeric IDs have and unique (per QWidgetStack, not globally) and cannot be -1, but apart from that QWidgetStack does not attach any meaning to them.

The default widget stack is frame-less and propagates its font and palette to all its children, but you can use the usual QFrame functions (like setFrameStyle()) to add a frame, and use setFontPropagation() and setPalettePropagation() to change the propagation style.

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

See also QTabDialog, QTabBar and QFrame.

Examples: xform/xform.cpp

MEMBER FUNCTION DOCUMENTATION

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

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

void QWidgetStack::aboutToShow ( QWidget * ) [signal]
This signal is emitted just before a managed widget is shown. The argument is a pointer to the widget.

void QWidgetStack::aboutToShow ( int ) [signal]
This signal is emitted just before a managed widget is shown, if that managed widget has a non-zero ID. The argument is the numeric ID of the widget.

void QWidgetStack::addWidget ( QWidget * w, int id )
Adds w to this stack of widgets, with id id.

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

Note that the added children are initially hidden. After you have added the widgets you want to the stack, you may want to call raiseWidget() on one of them.

Examples: xform/xform.cpp

void QWidgetStack::childEvent ( QChildEvent * e ) [virtual protected]
Reimplemented for internal reasons; the API is not affected.

Reimplemented from QObject.

void QWidgetStack::frameChanged () [virtual protected]
Reimplemented for internal reasons; the API is not affected.

Reimplemented from QFrame.

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

QSize QWidgetStack::minimumSizeHint () const [virtual]
Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

void QWidgetStack::raiseWidget ( QWidget * w ) [slot]
Raises w to the top of the widget stack.

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

See also visibleWidget().

Examples: xform/xform.cpp

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

See also visibleWidget() and raiseWidget().

void QWidgetStack::resizeEvent ( QResizeEvent * e ) [virtual protected]
Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

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

void QWidgetStack::setFrameRect ( const QRect & r ) [virtual]
Reimplemented for internal reasons; the API is not affected.

Reimplemented from QFrame.

void QWidgetStack::show () [virtual]
Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

QSize QWidgetStack::sizeHint () const [virtual]
Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

QWidget * QWidgetStack::visibleWidget () const
Returns a pointer to the currently visible widget (the one on 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 make our job much simpler. Thank you.

In case of content or formattting problems with 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 (2.3.7).