com.trolltech.qt.gui
Class QTabWidget

java.lang.Object
  extended by com.trolltech.qt.internal.QSignalEmitterInternal
      extended by com.trolltech.qt.QSignalEmitter
          extended by com.trolltech.qt.QtJambiObject
              extended by com.trolltech.qt.core.QObject
                  extended by com.trolltech.qt.gui.QWidget
                      extended by com.trolltech.qt.gui.QTabWidget
All Implemented Interfaces:
QPaintDeviceInterface, QtJambiInterface

public class QTabWidget
extends QWidget

The QTabWidget class provides a stack of tabbed widgets. A tab widget provides a tab bar (see QTabBar) and a "page area" that is used to display pages related to each tab. By default, the tab bar is shown above the page area, but different configurations are available (see TabPosition ). Each tab is associated with a different widget (called a page). Only the current page is shown in the page area; all the other pages are hidden. The user can show a different page by clicking on its tab or by pressing its Alt+letter shortcut if it has one.

The normal way to use QTabWidget is to do the following:

  1. Create a QTabWidget.
  2. Create a QWidget for each of the pages in the tab dialog, but do not specify parent widgets for them.
  3. Insert child widgets into the page widget, using layouts to position them as normal.
  4. Call addTab() or insertTab() to put the page widgets into the tab widget, giving each tab a suitable label with an optional keyboard shortcut.
The position of the tabs is defined by tabPosition, their shape by tabShape.

The signal currentChanged() is emitted when the user selects a page.

The current page index is available as currentIndex(), the current page widget with currentWidget(). 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(). Use setCurrentWidget() or setCurrentIndex() to show a particular page.

You can change a tab's text and icon using setTabText() or setTabIcon(). A tab and its associated page can be removed with removeTab().

Each tab is either enabled or disabled at any given time (see setTabEnabled()). If a tab is enabled, the tab text is drawn normally and the user can select that tab. If it is disabled, the tab is drawn in a different way and the user cannot select that tab. Note that even if a tab is disabled, the page can still be visible, for example if all of the tabs happen to be disabled.

Tab widgets can be a very good way to split up a complex dialog. An alternative is to use a QStackedWidget for which you provide some means of navigating between pages, for example, a QToolBar or a QListWidget.

Most of the functionality in QTabWidget is provided by a QTabBar (at the top, providing the tabs) and a QStackedWidget (most of the area, organizing the individual pages).







A Windows XP style tab widget. A Macintosh style tab widget. A Plastique style tab widget.

See also:
QTabBar, QStackedWidget, QToolBox, and Tab Dialog Example.


Nested Class Summary
static class QTabWidget.TabPosition
          This enum type defines where QTabWidget draws the tab row:
static class QTabWidget.TabShape
          This enum type defines the shape of the tabs.
 
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget
QWidget.RenderFlag, QWidget.RenderFlags
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.PrivateSignal0, QSignalEmitter.PrivateSignal1, QSignalEmitter.PrivateSignal2, QSignalEmitter.PrivateSignal3, QSignalEmitter.PrivateSignal4, QSignalEmitter.PrivateSignal5, QSignalEmitter.PrivateSignal6, QSignalEmitter.PrivateSignal7, QSignalEmitter.PrivateSignal8, QSignalEmitter.PrivateSignal9, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9
 
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal
 
Field Summary
 QSignalEmitter.Signal1 currentChanged
          This signal takes 1 generic argument(s).
 QSignalEmitter.Signal1 tabCloseRequested
          This signal takes 1 generic argument(s).
 
Fields inherited from class com.trolltech.qt.gui.QWidget
customContextMenuRequested
 
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
currentSender
 
Constructor Summary
QTabWidget()
          Constructs a tabbed widget with parent parent.
QTabWidget(QWidget parent)
          Constructs a tabbed widget with parent parent.
 
Method Summary
 int addTab(QWidget widget, QIcon icon, java.lang.String label)
          This is an overloaded member function, provided for convenience.
 int addTab(QWidget widget, java.lang.String arg__2)
          Adds a tab with the given page and label to the tab widget, and returns the index of the tab in the tab bar.
 void clear()
          Removes all the pages, but does not delete them.
 QWidget cornerWidget()
          Returns the widget shown in the corner of the tab widget or 0.
 QWidget cornerWidget(Qt.Corner corner)
          Returns the widget shown in the corner of the tab widget or 0.
 int count()
          This property holds the number of tabs in the tab bar.
 int currentIndex()
          This property holds the index position of the current tab page.
 QWidget currentWidget()
          Returns a pointer to the page currently being displayed by the tab dialog.
 boolean documentMode()
          This property holds Whether or not the tab widget is rendered in a mode suitable for document pages.
 Qt.TextElideMode elideMode()
          This property holds how to elide text in the tab bar.
 QSize iconSize()
          This property holds The size for icons in the tab bar.
 int indexOf(QWidget widget)
          Returns the index position of the page occupied by the widget w, or -1 if the widget cannot be found.
protected  void initStyleOption(QStyleOptionTabWidgetFrame option)
          Initialize option with the values from this QTabWidget.
 int insertTab(int index, QWidget widget, QIcon icon, java.lang.String label)
          This is an overloaded member function, provided for convenience.
 int insertTab(int index, QWidget widget, java.lang.String arg__3)
          Inserts a tab with the given label and page into the tab widget at the specified index, and returns the index of the inserted tab in the tab bar.
 boolean isMovable()
          This property holds This property holds whether the user can move the tabs within the tabbar area.
 boolean isTabEnabled(int index)
          Returns true if the the page at position index is enabled; otherwise returns false.
 void removeTab(int index)
          Removes the tab at position index from this stack of widgets.
 void setCornerWidget(QWidget w)
          Sets the given widget to be shown in the specified corner of the tab widget.
 void setCornerWidget(QWidget w, Qt.Corner corner)
          Sets the given widget to be shown in the specified corner of the tab widget.
 void setCurrentIndex(int index)
          This property holds the index position of the current tab page.
 void setCurrentWidget(QWidget widget)
          Makes widget the current widget.
 void setDocumentMode(boolean set)
          This property holds Whether or not the tab widget is rendered in a mode suitable for document pages.
 void setElideMode(Qt.TextElideMode arg__1)
          This property holds how to elide text in the tab bar.
 void setIconSize(QSize size)
          This property holds The size for icons in the tab bar.
 void setMovable(boolean movable)
          This property holds This property holds whether the user can move the tabs within the tabbar area.
protected  void setTabBar(QTabBar arg__1)
          Replaces the dialog's QTabBar heading with the tab bar tb.
 void setTabEnabled(int index, boolean arg__2)
          If enable is true, the page at position index is enabled; otherwise the page at position index is disabled.
 void setTabIcon(int index, QIcon icon)
          This is an overloaded member function, provided for convenience.
 void setTabPosition(QTabWidget.TabPosition arg__1)
          This property holds the position of the tabs in this tab widget.
 void setTabsClosable(boolean closeable)
          This property holds whether close buttons are automatically added to each tab.
 void setTabShape(QTabWidget.TabShape s)
          This property holds the shape of the tabs in this tab widget.
 void setTabText(int index, java.lang.String arg__2)
          Defines a new label for the page at position index's tab.
 void setTabToolTip(int index, java.lang.String tip)
          Sets the tab tool tip for the page at position index to tip.
 void setTabWhatsThis(int index, java.lang.String text)
          Sets the What's This help text for the page at position index to text.
 void setUsesScrollButtons(boolean useButtons)
          This property holds Whether or not a tab bar should use buttons to scroll tabs when it has many tabs.
protected  QTabBar tabBar()
          Returns the current QTabBar.
 QIcon tabIcon(int index)
          Returns the icon for the tab on the page at position index.
protected  void tabInserted(int index)
          This virtual handler is called after a new tab was added or inserted at position index.
 QTabWidget.TabPosition tabPosition()
          This property holds the position of the tabs in this tab widget.
protected  void tabRemoved(int index)
          This virtual handler is called after a tab was removed from position index.
 boolean tabsClosable()
          This property holds whether close buttons are automatically added to each tab.
 QTabWidget.TabShape tabShape()
          This property holds the shape of the tabs in this tab widget.
 java.lang.String tabText(int index)
          Returns the label text for the tab on the page at position index.
 java.lang.String tabToolTip(int index)
          Returns the tab tool tip for the page at position index or an empty string if no tool tip has been set.
 java.lang.String tabWhatsThis(int index)
          Returns the What's This help text for the page at position index, or an empty string if no help text has been set.
 boolean usesScrollButtons()
          This property holds Whether or not a tab bar should use buttons to scroll tabs when it has many tabs.
 QWidget widget(int index)
          Returns the tab page at index position index or 0 if the index is out of range.
 
Methods inherited from class com.trolltech.qt.gui.QWidget
acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, changeEvent, childAt, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, closeEvent, contentsRect, contextMenuEvent, contextMenuPolicy, cursor, depth, destroy, destroy, destroy, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, effectiveWinId, ensurePolished, enterEvent, focusInEvent, focusNextChild, focusNextPrevChild, focusOutEvent, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabKeyboard, grabMouse, grabMouse, grabShortcut, grabShortcut, graphicsProxyWidget, hasFocus, hasMouseTracking, height, heightForWidth, heightMM, hide, hideEvent, inputContext, inputMethodEvent, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isFullScreen, isHidden, isMaximized, isMinimized, isModal, isVisible, isVisibleTo, isWindow, isWindowModified, keyboardGrabber, keyPressEvent, keyReleaseEvent, languageChange, layout, layoutDirection, leaveEvent, locale, logicalDpiX, logicalDpiY, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumSizeHint, minimumWidth, mouseDoubleClickEvent, mouseGrabber, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, move, move, moveEvent, nativeParentWidget, nextInFocusChain, normalGeometry, numColors, overrideWindowFlags, overrideWindowFlags, overrideWindowState, paintEngine, paintEvent, paintingActive, palette, parentWidget, physicalDpiX, physicalDpiY, pos, raise, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, render, render, render, render, render, render, render, render, repaint, repaint, repaint, repaint, resetInputContext, resize, resize, resizeEvent, restoreGeometry, saveGeometry, scroll, scroll, setAcceptDrops, setAccessibleDescription, setAccessibleName, setAttribute, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setBaseSize, setContentsMargins, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedSize, setFixedWidth, setFocus, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setGeometry, setHidden, setInputContext, setLayout, setLayoutDirection, setLocale, setMask, setMask, setMaximumHeight, setMaximumSize, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setParent, setParent, setShortcutAutoRepeat, setShortcutAutoRepeat, setShortcutEnabled, setShortcutEnabled, setSizeIncrement, setSizeIncrement, setSizePolicy, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFilePath, setWindowFlags, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowState, setWindowTitle, show, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeHint, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, toolTip, underMouse, unsetCursor, unsetLayoutDirection, unsetLocale, update, update, update, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, wheelEvent, width, widthMM, window, windowFilePath, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, winId, x, y
 
Methods inherited from class com.trolltech.qt.core.QObject
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
__qt_signalInitialization
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Field Detail

currentChanged

public final QSignalEmitter.Signal1 currentChanged

This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Integer(named: index)>:

This signal is emitted whenever the current page index changes. The parameter is the new current page index position, or -1 if there isn't a new one (for example, if there are no widgets in the QTabWidget)

See also:
currentWidget(), and currentIndex.


tabCloseRequested

public final QSignalEmitter.Signal1 tabCloseRequested

This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Integer(named: index)>:

This signal is emitted when the close button on a tab is clicked. The index is the index that should be removed.

See also:
setTabsClosable().

Constructor Detail

QTabWidget

public QTabWidget()
Constructs a tabbed widget with parent parent.


QTabWidget

public QTabWidget(QWidget parent)
Constructs a tabbed widget with parent parent.

Method Detail

addTab

public final int addTab(QWidget widget,
                        QIcon icon,
                        java.lang.String label)
This is an overloaded member function, provided for convenience.

Adds a tab with the given page, icon, and label to the tab widget, and returns the index of the tab in the tab bar.

This function is the same as addTab(), but with an additional icon.


addTab

public final int addTab(QWidget widget,
                        java.lang.String arg__2)
Adds a tab with the given page and label to the tab widget, and returns the index of the tab in the tab bar.

If the tab's label contains an ampersand, the letter following the ampersand is used as a shortcut for the tab, e.g. if the label is "Bro&wse" then Alt+W becomes a shortcut which will move the focus to this tab.

Note: If you call addTab() after show(), the layout system will try to adjust to the changes in its widgets hierarchy and may cause flicker. To prevent this, you can set the QWidget::updatesEnabled property to false prior to changes; remember to set the property to true when the changes are done, making the widget receive paint events again.

See also:
insertTab().


clear

public final void clear()
Removes all the pages, but does not delete them. Calling this function is equivalent to calling removeTab() until the tab widget is empty.


cornerWidget

public final QWidget cornerWidget()
Returns the widget shown in the corner of the tab widget or 0.

See also:
setCornerWidget().


cornerWidget

public final QWidget cornerWidget(Qt.Corner corner)
Returns the widget shown in the corner of the tab widget or 0.

See also:
setCornerWidget().


count

public final int count()
This property holds the number of tabs in the tab bar. By default, this property contains a value of 0.


currentIndex

public final int currentIndex()
This property holds the index position of the current tab page. The current index is -1 if there is no current widget.

By default, this property contains a value of -1 because there are initially no tabs in the widget.


currentWidget

public final QWidget currentWidget()
Returns a pointer to the page currently being displayed by the tab dialog. The tab dialog does its best to make sure that this value is never 0 (but if you try hard enough, it can be).

See also:
currentIndex(), and setCurrentWidget().


documentMode

public final boolean documentMode()
This property holds Whether or not the tab widget is rendered in a mode suitable for document pages. This is the same as document mode on Mac OS X.. When this property is set the tab widget frame is not rendered. This mode is useful for showing document-type pages where the page covers most of the tab widget area.

See also:
elideMode, QTabBar::documentMode, QTabBar::usesScrollButtons, and QStyle::SH_TabBar_PreferNoArrows .


elideMode

public final Qt.TextElideMode elideMode()
This property holds how to elide text in the tab bar. This property controls how items are elided when there is not enough space to show them for a given tab bar size.

By default the value is style dependant.

See also:
QTabBar::elideMode, usesScrollButtons, and QStyle::SH_TabBar_ElideMode .


iconSize

public final QSize iconSize()
This property holds The size for icons in the tab bar. The default value is style-dependent. This is the maximum size that the icons will have. Icons are not scaled up if they are of smaller size.

See also:
QTabBar::iconSize.


indexOf

public final int indexOf(QWidget widget)
Returns the index position of the page occupied by the widget w, or -1 if the widget cannot be found.


insertTab

public final int insertTab(int index,
                           QWidget widget,
                           QIcon icon,
                           java.lang.String label)
This is an overloaded member function, provided for convenience.

Inserts a tab with the given label, page, and icon into the tab widget at the specified index, and returns the index of the inserted tab in the tab bar.

This function is the same as insertTab(), but with an additional icon.


insertTab

public final int insertTab(int index,
                           QWidget widget,
                           java.lang.String arg__3)
Inserts a tab with the given label and page into the tab widget at the specified index, and returns the index of the inserted tab in the tab bar.

The label is displayed in the tab and may vary in appearance depending on the configuration of the tab widget.

If the tab's label contains an ampersand, the letter following the ampersand is used as a shortcut for the tab, e.g. if the label is "Bro&wse" then Alt+W becomes a shortcut which will move the focus to this tab.

If index is out of range, the tab is simply appended. Otherwise it is inserted at the specified position.

If the QTabWidget was empty before this function is called, the new page becomes the current page. Inserting a new tab at an index less than or equal to the current index will increment the current index, but keep the current page.

Note: If you call insertTab() after show(), the layout system will try to adjust to the changes in its widgets hierarchy and may cause flicker. To prevent this, you can set the QWidget::updatesEnabled property to false prior to changes; remember to set the property to true when the changes are done, making the widget receive paint events again.

See also:
addTab().


isMovable

public final boolean isMovable()
This property holds This property holds whether the user can move the tabs within the tabbar area. By default, this property is false;


isTabEnabled

public final boolean isTabEnabled(int index)
Returns true if the the page at position index is enabled; otherwise returns false.

See also:
setTabEnabled(), and QWidget::isEnabled().


removeTab

public final void removeTab(int index)
Removes the tab at position index from this stack of widgets. The page widget itself is not deleted.

See also:
addTab(), and insertTab().


setCornerWidget

public final void setCornerWidget(QWidget w)
Sets the given widget to be shown in the specified corner of the tab widget. The geometry of the widget is determined based on the widget's sizeHint() and the style().

Only the horizontal element of the corner will be used.

Passing 0 shows no widget in the corner.

Any previously set corner widget is hidden.

All widgets set here will be deleted by the tab widget when it is destroyed unless you separately reparent the widget after setting some other corner widget (or 0).

Note: Corner widgets are designed for North and South tab positions; other orientations are known to not work properly.

See also:
cornerWidget(), and setTabPosition().


setCornerWidget

public final void setCornerWidget(QWidget w,
                                  Qt.Corner corner)
Sets the given widget to be shown in the specified corner of the tab widget. The geometry of the widget is determined based on the widget's sizeHint() and the style().

Only the horizontal element of the corner will be used.

Passing 0 shows no widget in the corner.

Any previously set corner widget is hidden.

All widgets set here will be deleted by the tab widget when it is destroyed unless you separately reparent the widget after setting some other corner widget (or 0).

Note: Corner widgets are designed for North and South tab positions; other orientations are known to not work properly.

See also:
cornerWidget(), and setTabPosition().


setCurrentIndex

public final void setCurrentIndex(int index)
This property holds the index position of the current tab page. The current index is -1 if there is no current widget.

By default, this property contains a value of -1 because there are initially no tabs in the widget.


setCurrentWidget

public final void setCurrentWidget(QWidget widget)
Makes widget the current widget. The widget used must be a page in this tab widget.

See also:
addTab(), setCurrentIndex(), and currentWidget().


setDocumentMode

public final void setDocumentMode(boolean set)
This property holds Whether or not the tab widget is rendered in a mode suitable for document pages. This is the same as document mode on Mac OS X.. When this property is set the tab widget frame is not rendered. This mode is useful for showing document-type pages where the page covers most of the tab widget area.

See also:
elideMode, QTabBar::documentMode, QTabBar::usesScrollButtons, and QStyle::SH_TabBar_PreferNoArrows .


setElideMode

public final void setElideMode(Qt.TextElideMode arg__1)
This property holds how to elide text in the tab bar. This property controls how items are elided when there is not enough space to show them for a given tab bar size.

By default the value is style dependant.

See also:
QTabBar::elideMode, usesScrollButtons, and QStyle::SH_TabBar_ElideMode .


setIconSize

public final void setIconSize(QSize size)
This property holds The size for icons in the tab bar. The default value is style-dependent. This is the maximum size that the icons will have. Icons are not scaled up if they are of smaller size.

See also:
QTabBar::iconSize.


setMovable

public final void setMovable(boolean movable)
This property holds This property holds whether the user can move the tabs within the tabbar area. By default, this property is false;


setTabBar

protected final void setTabBar(QTabBar arg__1)
Replaces the dialog's QTabBar heading with the tab bar tb. Note that this must be called before any tabs have been added, or the behavior is undefined.

See also:
tabBar().


setTabEnabled

public final void setTabEnabled(int index,
                                boolean arg__2)
If enable is true, the page at position index is enabled; otherwise the page at position index is disabled. The page's tab is redrawn appropriately.

QTabWidget uses QWidget::setEnabled() internally, rather than keeping a separate flag.

Note that even a disabled tab/page may be visible. If the page is visible already, QTabWidget will not hide it; if all the pages are disabled, QTabWidget will show one of them.

See also:
isTabEnabled(), and QWidget::setEnabled().


setTabIcon

public final void setTabIcon(int index,
                             QIcon icon)
This is an overloaded member function, provided for convenience.

Sets the icon for the tab at position index.

See also:
tabIcon().


setTabPosition

public final void setTabPosition(QTabWidget.TabPosition arg__1)
This property holds the position of the tabs in this tab widget. Possible values for this property are described by the TabPosition enum.

By default, this property is set to North .

See also:
TabPosition .


setTabShape

public final void setTabShape(QTabWidget.TabShape s)
This property holds the shape of the tabs in this tab widget. Possible values for this property are QTabWidget::Rounded (default) or QTabWidget::Triangular .

See also:
TabShape .


setTabText

public final void setTabText(int index,
                             java.lang.String arg__2)
Defines a new label for the page at position index's tab.

If the provided text contains an ampersand character ('&'), a shortcut is automatically created for it. The character that follows the '&' will be used as the shortcut key. Any previous shortcut will be overwritten, or cleared if no shortcut is defined by the text. See the QShortcut documentation for details (to display an actual ampersand, use '&&').

See also:
tabText().


setTabToolTip

public final void setTabToolTip(int index,
                                java.lang.String tip)
Sets the tab tool tip for the page at position index to tip.

See also:
tabToolTip().


setTabWhatsThis

public final void setTabWhatsThis(int index,
                                  java.lang.String text)
Sets the What's This help text for the page at position index to text.

See also:
tabWhatsThis().


setTabsClosable

public final void setTabsClosable(boolean closeable)
This property holds whether close buttons are automatically added to each tab.

See also:
QTabBar::tabsClosable().


setUsesScrollButtons

public final void setUsesScrollButtons(boolean useButtons)
This property holds Whether or not a tab bar should use buttons to scroll tabs when it has many tabs. When there are too many tabs in a tab bar for its size, the tab bar can either choose to expand its size or to add buttons that allow you to scroll through the tabs.

By default the value is style dependant.

See also:
elideMode, QTabBar::usesScrollButtons, and QStyle::SH_TabBar_PreferNoArrows .


tabBar

protected final QTabBar tabBar()
Returns the current QTabBar.

See also:
setTabBar().


tabIcon

public final QIcon tabIcon(int index)
Returns the icon for the tab on the page at position index.

See also:
setTabIcon().


tabPosition

public final QTabWidget.TabPosition tabPosition()
This property holds the position of the tabs in this tab widget. Possible values for this property are described by the TabPosition enum.

By default, this property is set to North .

See also:
TabPosition .


tabShape

public final QTabWidget.TabShape tabShape()
This property holds the shape of the tabs in this tab widget. Possible values for this property are QTabWidget::Rounded (default) or QTabWidget::Triangular .

See also:
TabShape .


tabText

public final java.lang.String tabText(int index)
Returns the label text for the tab on the page at position index.

See also:
setTabText().


tabToolTip

public final java.lang.String tabToolTip(int index)
Returns the tab tool tip for the page at position index or an empty string if no tool tip has been set.

See also:
setTabToolTip().


tabWhatsThis

public final java.lang.String tabWhatsThis(int index)
Returns the What's This help text for the page at position index, or an empty string if no help text has been set.

See also:
setTabWhatsThis().


tabsClosable

public final boolean tabsClosable()
This property holds whether close buttons are automatically added to each tab.

See also:
QTabBar::tabsClosable().


usesScrollButtons

public final boolean usesScrollButtons()
This property holds Whether or not a tab bar should use buttons to scroll tabs when it has many tabs. When there are too many tabs in a tab bar for its size, the tab bar can either choose to expand its size or to add buttons that allow you to scroll through the tabs.

By default the value is style dependant.

See also:
elideMode, QTabBar::usesScrollButtons, and QStyle::SH_TabBar_PreferNoArrows .


widget

public final QWidget widget(int index)
Returns the tab page at index position index or 0 if the index is out of range.


tabInserted

protected void tabInserted(int index)
This virtual handler is called after a new tab was added or inserted at position index.

See also:
tabRemoved().


tabRemoved

protected void tabRemoved(int index)
This virtual handler is called after a tab was removed from position index.

See also:
tabInserted().


initStyleOption

protected final void initStyleOption(QStyleOptionTabWidgetFrame option)
Initialize option with the values from this QTabWidget. This method is useful for subclasses when they need a QStyleOptionSlider, but don't want to fill in all the information themselves.