
You can change a tab's text and icon using setTabText() or setTabIcon(). Use setCurrentWidget() or setCurrentIndex() to show a particular page. You can retrieve a pointer to a page widget with a given index using widget(), and can find the index position of a widget with indexOf(). The current page index is available as currentIndex(), the current page widget with currentWidget(). The signal currentChanged() is emitted when the user selects a page. The position of the tabs is defined by tabPosition, their shape by tabShape. Call addTab() or insertTab() to put the page widgets into the tab widget, giving each tab a suitable label with an optional keyboard shortcut.Insert child widgets into the page widget, using layouts to position them as normal.


The QTabWidget class provides a stack of tabbed widgets.Ī tab widget provides a tab bar (see QTabBar) and a "page area" that is used to display pages related to each tab.

SetTabWhatsThis(int index, const QString & text) SetTabToolTip(int index, const QString & tip) SetTabText(int index, const QString & label) SetTabIcon(int index, const QIcon & icon) SetCornerWidget(QWidget * widget, Qt::Corner corner = Qt::TopRightCorner) InsertTab(int index, QWidget * page, const QIcon & icon, const QString & label) InsertTab(int index, QWidget * page, const QString & label) AddTab(QWidget * page, const QString & label)ĪddTab(QWidget * page, const QIcon & icon, const QString & label)ĬornerWidget(Qt::Corner corner = Qt::TopRightCorner) const
