Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions

QStackedBox Class Reference

The QStackedBox class provides a stack of widgets where only the top widget is visible. More...

#include <QStackedBox>

Inherits QFrame.

List of all members.

Writable Properties

Read-Only Properties

Public Functions

Public Slots

Signals

Static Public Members

Protected Functions


Detailed Description

The QStackedBox class provides a stack of widgets where only the top widget is visible.

All the horizontal box's child widgets will be placed on top of each other, and only the top one will be visible to the user. This top widget is the currentWidget(). It can be changed by setting the currentIndex property, using setCurrentIndex(). The index of a given widget inside the stacked box is retrieved with indexOf(); widget() returns the widget at a given index position.

If you just need a stacked layout (not a widget), use QStackedLayout instead.

See also QTabWidget.


Property Documentation

count : int

This property holds the number of widgets in this layout.

Access functions:

currentIndex : int

This property holds the index position of the current widget.

The current index is -1 if there is no current widget. The widget at index position 0 is the one that is on top (i.e. the one that is visible).

Access functions:

See also currentWidget() and indexOf().


Member Function Documentation

QStackedBox::QStackedBox ( QWidget * parent = 0 )

Constructs a new QStackedBox as a child of parent.

QStackedBox::~QStackedBox ()

Destroys the object and frees any allocated resources.

int QStackedBox::addWidget ( QWidget * w )

Adds w to this box. The first widget added becomes the initial current widget. Returns the index of w in this box.

void QStackedBox::currentChanged ( int index )   [signal]

This signal is emitted when the current widget is changed. The parameter holds the index of the new current widget, or -1 if there isn't a new one (for example, if there are no widgets in the stacked box).

QWidget * QStackedBox::currentWidget () const

Returns the current widget, or 0 if there are no child widgets.

int QStackedBox::indexOf ( QWidget * w ) const

Returns the index of w, or -1 if w is not a child.

int QStackedBox::insertWidget ( int index, QWidget * w )

Inserts w to this box at position index. If index is out of range, the widget gets appened. The first widget added becomes the initial current widget. Returns the index of w in this box.

void QStackedBox::removeWidget ( QWidget * w )

Removes widget w from this layout, but does not delete it.

QWidget * QStackedBox::widget ( int index ) const

Returns the widget at position index, or 0 if there is no such widget.

void QStackedBox::widgetRemoved ( int index )   [signal]

This signal is emitted when the widget at position index is removed.


Copyright © 2004 Trolltech. Trademarks
Qt 4.0.0-tp1