QToolBox Class

The QToolBox class provides a column of tabbed widget items. More...

Header: #include <QToolBox>
qmake: QT += widgets
Inherits: QFrame

Properties

Public Functions

int count() const
int currentIndex() const

Public Slots

void setCurrentIndex(int index)

Signals

void currentChanged(int index)

Detailed Description

A toolbox is a widget that displays a column of tabs one above the other, with the current item displayed below the current tab. Every tab has an index position within the column of tabs. A tab's item is a QWidget.

Each item has an itemText(), an optional itemIcon(), an optional itemToolTip(), and a widget(). The item's attributes can be changed with setItemText(), setItemIcon(), and setItemToolTip(). Each item can be enabled or disabled individually with setItemEnabled().

Items are added using addItem(), or inserted at particular positions using insertItem(). The total number of items is given by count(). Items can be deleted with delete, or removed from the toolbox with removeItem(). Combining removeItem() and insertItem() allows you to move items to different positions.

The index of the current item widget is returned by currentIndex(), and set with setCurrentIndex(). The index of a particular item can be found using indexOf(), and the item at a given index is returned by item().

The currentChanged() signal is emitted when the current item is changed.

See also QTabWidget.

Property Documentation

count : const int

This property holds the number of items contained in the toolbox.

By default, this property has a value of 0.

Access functions:

int count() const

currentIndex : int

This property holds the index of the current item

By default, for an empty toolbox, this property has a value of -1.

Access functions:

int currentIndex() const
void setCurrentIndex(int index)

Notifier signal:

void currentChanged(int index)

See also indexOf() and widget().