Q3WidgetStack Class | Qt 4.8 (original) (raw)

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

Member Function Documentation

Q3WidgetStack::Q3WidgetStack(QWidget * parent, const char * name = 0, Qt::WindowFlags f = 0)

Constructs an empty widget stack.

The parent, name and f arguments are passed to the Q3Frame constructor.

Q3WidgetStack::~Q3WidgetStack()

Destroys the object and frees any allocated resources.

[signal] void Q3WidgetStack::aboutToShow(int id)

This signal is emitted just before a managed widget is shown if that managed widget has an ID != -1. The id parameter is the numeric ID of the widget.

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.

**Note:**Signal aboutToShow is overloaded in this class. To connect to this one using the function pointer syntax, you must specify the signal type in a static cast, as shown in this example:

[signal] void Q3WidgetStack::aboutToShow(QWidget * widget)

This is an overloaded function.

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

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.

**Note:**Signal aboutToShow is overloaded in this class. To connect to this one using the function pointer syntax, you must specify the signal type in a static cast, as shown in this example:

int Q3WidgetStack::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. Returns the ID or -1 on failure (e.g. w is 0).

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.

If w already exists in the stack the widget will be removed first.

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

[virtual protected] void Q3WidgetStack::childEvent(QChildEvent * e)

Reimplemented from QObject::childEvent().

[virtual protected] bool Q3WidgetStack::event(QEvent * e)

Reimplemented from QObject::event().

[virtual protected] void Q3WidgetStack::frameChanged()

Reimplemented from Q3Frame::frameChanged().

int Q3WidgetStack::id(QWidget * widget) const

Returns the ID of the widget. Returns -1 if widget is 0 or is not being managed by this widget stack.

See also widget() and addWidget().

[virtual] QSize Q3WidgetStack::minimumSizeHint() const

Reimplemented from QWidget::minimumSizeHint().

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

Raises the widget with ID id to the top of the widget stack.

See also visibleWidget().

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

This is an overloaded function.

Raises widget w to the top of the widget stack.

void Q3WidgetStack::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.

See also visibleWidget() and raiseWidget().

[virtual protected] void Q3WidgetStack::resizeEvent(QResizeEvent * e)

Reimplemented from QWidget::resizeEvent().

[virtual protected] void Q3WidgetStack::setChildGeometries()

Fixes up the children's geometries.

[virtual] void Q3WidgetStack::setVisible(bool visible)

Reimplemented from QWidget::setVisible().

[virtual] QSize Q3WidgetStack::sizeHint() const

Reimplemented from QWidget::sizeHint().

QWidget * Q3WidgetStack::visibleWidget() const

Returns 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 * Q3WidgetStack::widget(int id) const

Returns the widget with ID id. Returns 0 if this widget stack does not manage a widget with ID id.

See also id() and addWidget().