com.trolltech.qt.gui
Class QTabBar

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.QTabBar
All Implemented Interfaces:
QPaintDeviceInterface, QtJambiInterface

public class QTabBar
extends QWidget

The QTabBar class provides a tab bar, e. . for use in tabbed dialogs. QTabBar is straightforward to use; it draws the tabs using one of the predefined shapes , and emits a signal when a tab is selected. It can be subclassed to tailor the look and feel. Qt also provides a ready-made QTabWidget.

Each tab has a tabText(), an optional tabIcon(), an optional tabToolTip(), optional tabWhatsThis() and optional tabData(). The tabs's attributes can be changed with setTabText(), setTabIcon(), setTabToolTip(), setTabWhatsThis and setTabData(). Each tabs can be enabled or disabled individually with setTabEnabled().

Each tab can display text in a distinct color. The current text color for a tab can be found with the tabTextColor() function. Set the text color for a particular tab with setTabTextColor().

Tabs are added using addTab(), or inserted at particular positions using insertTab(). The total number of tabs is given by count(). Tabs can be removed from the tab bar with removeTab(). Combining removeTab() and insertTab() allows you to move tabs to different positions.

The shape property defines the tabs' appearance. The choice of shape is a matter of taste, although tab dialogs (for preferences and similar) invariably use RoundedNorth . Tab controls in windows other than dialogs almost always use either RoundedSouth or TriangularSouth . Many spreadsheets and other tab controls in which all the pages are essentially similar use TriangularSouth , whereas RoundedSouth is used mostly when the pages are different (e.g. a multi-page tool palette). The default in QTabBar is RoundedNorth .

The most important part of QTabBar's API is the currentChanged() signal. This is emitted whenever the current tab changes (even at startup, when the current tab changes from 'none'). There is also a slot, setCurrentIndex(), which can be used to select a tab programmatically. The function currentIndex() returns the index of the current tab, count holds the number of tabs.

QTabBar creates automatic mnemonic keys in the manner of QAbstractButton; e.g. if a tab's label is "&Graphics", Alt+G becomes a shortcut key for switching to that tab.

The following virtual functions may need to be reimplemented in order to tailor the look and feel or store extra data with each tab:

For subclasses, you might also need the tabRect() functions which returns the visual geometry of a single tab.


A tab bar shown in the Plastique widget style.


A truncated tab bar shown in the Plastique widget style.

See also:
QTabWidget.


Nested Class Summary
static class QTabBar.ButtonPosition
          This enum type lists the location of the widget on a tab.
static class QTabBar.SelectionBehavior
          This enum type lists the behavior of QTabBar when a tab is removed and the tab being removed is also the current tab.
static class QTabBar.Shape
          This enum type lists the built-in shapes supported by QTabBar.
 
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).
 QSignalEmitter.Signal2 tabMoved
          This signal takes 2 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
QTabBar()
          Creates a new tab bar with the given parent.
QTabBar(QWidget parent)
          Creates a new tab bar with the given parent.
 
Method Summary
 int addTab(QIcon icon, java.lang.String text)
          This is an overloaded member function, provided for convenience.
 int addTab(java.lang.String text)
          Adds a new tab with text text.
 int count()
          This property holds the number of tabs in the tab bar.
 int currentIndex()
          This property holds the index of the tab bar's visible tab.
 boolean documentMode()
          This property holds Whether or not the tab bar is rendered in a mode suitable for the main window.
 boolean drawBase()
          This property defines whether or not tab bar should draw its base.
 Qt.TextElideMode elideMode()
          This property holds how to elide text in the tab bar.
 boolean expanding()
          This property holds When expanding is true QTabBar will expand the tabs to use the empty space.
 QSize iconSize()
          This property holds The size for icons in the tab bar.
 void initStyleOption(QStyleOptionTab option, int tabIndex)
          Initialize option with the values from the tab at tabIndex.
 int insertTab(int index, QIcon icon, java.lang.String text)
          This is an overloaded member function, provided for convenience.
 int insertTab(int index, java.lang.String text)
          Inserts a new tab with text text at position index.
 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 tab at position index is enabled; otherwise returns false.
 void moveTab(int from, int to)
          Moves the item at index position from to index position to.
 void removeTab(int index)
          Removes the tab at position index.
 QTabBar.SelectionBehavior selectionBehaviorOnRemove()
          This property holds What tab should be set as current when removeTab is called if the removed tab is also the current tab.
 void setCurrentIndex(int index)
          This property holds the index of the tab bar's visible tab.
 void setDocumentMode(boolean set)
          This property holds Whether or not the tab bar is rendered in a mode suitable for the main window.
 void setDrawBase(boolean drawTheBase)
          This property defines whether or not tab bar should draw its base.
 void setElideMode(Qt.TextElideMode arg__1)
          This property holds how to elide text in the tab bar.
 void setExpanding(boolean enabled)
          This property holds When expanding is true QTabBar will expand the tabs to use the empty space.
 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.
 void setSelectionBehaviorOnRemove(QTabBar.SelectionBehavior behavior)
          This property holds What tab should be set as current when removeTab is called if the removed tab is also the current tab.
 void setShape(QTabBar.Shape shape)
          This property holds the shape of the tabs in the tab bar.
 void setTabButton(int index, QTabBar.ButtonPosition position, QWidget widget)
          Sets widget on the tab index.
 void setTabData(int index, java.lang.Object data)
          Sets the data of the tab at position index to data.
 void setTabEnabled(int index, boolean arg__2)
          If enabled is true then the tab at position index is enabled; otherwise the item at position index is disabled.
 void setTabIcon(int index, QIcon icon)
          Sets the icon of the tab at position index to icon.
 void setTabsClosable(boolean closable)
          This property holds Whether or not a tab bar should place close buttons on each tab.
 void setTabText(int index, java.lang.String text)
          Sets the text of the tab at position index to text.
 void setTabTextColor(int index, QColor color)
          Sets the color of the text in the tab with the given index to the specified color.
 void setTabToolTip(int index, java.lang.String tip)
          Sets the tool tip of the tab at position index to tip.
 void setTabWhatsThis(int index, java.lang.String text)
          Sets the What's This help text of the tab 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.
 QTabBar.Shape shape()
          This property holds the shape of the tabs in the tab bar.
 int tabAt(QPoint pos)
          Returns the index of the tab that covers position or -1 if no tab covers position;
 QWidget tabButton(int index, QTabBar.ButtonPosition position)
          Returns the widget set a tab index and position or 0 if one is not set.
 java.lang.Object tabData(int index)
          Returns the datad of the tab at position index, or a null variant if index is out of range.
 QIcon tabIcon(int index)
          Returns the icon of the tab at position index, or a null icon if index is out of range.
protected  void tabInserted(int index)
          This virtual handler is called after a new tab was added or inserted at position index.
protected  void tabLayoutChange()
          This virtual handler is called whenever the tab layout changes.
 QRect tabRect(int index)
          Returns the visual rectangle of the of the tab at position index, or a null rectangle if index is out of range.
protected  void tabRemoved(int index)
          This virtual handler is called after a tab was removed from position index.
 boolean tabsClosable()
          This property holds Whether or not a tab bar should place close buttons on each tab.
protected  QSize tabSizeHint(int index)
          Returns the size hint for the tab at position index.
 java.lang.String tabText(int index)
          Returns the text of the tab at position index, or an empty string if index is out of range.
 QColor tabTextColor(int index)
          Returns the text color of the tab with the given index, or a invalid color if index is out of range.
 java.lang.String tabToolTip(int index)
          Returns the tool tip of the tab at position index, or an empty string if index is out of range.
 java.lang.String tabWhatsThis(int index)
          Returns the What's This help text of the tab at position index, or an empty string if index is out of range.
 boolean usesScrollButtons()
          This property holds Whether or not a tab bar should use buttons to scroll tabs when it has many tabs.
 
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 when the tab bar's current tab changes. The new current has the given index, or -1 if there isn't a new one (for example, if there are no tab in the QTabBar)


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().


tabMoved

public final QSignalEmitter.Signal2 tabMoved

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

This signal is emitted when the tab has moved the tab at index position from to index position to.

note: QTabWidget will automatically move the page when this signal is emitted from its tab bar.

See also:
moveTab().

Constructor Detail

QTabBar

public QTabBar()
Creates a new tab bar with the given parent.


QTabBar

public QTabBar(QWidget parent)
Creates a new tab bar with the given parent.

Method Detail

addTab

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

Adds a new tab with icon icon and text text. Returns the new tab's index.


addTab

public final int addTab(java.lang.String text)
Adds a new tab with text text. Returns the new tab's index.


count

public final int count()
This property holds the number of tabs in the tab bar.


currentIndex

public final int currentIndex()
This property holds the index of the tab bar's visible tab. The current index is -1 if there is no current tab.


documentMode

public final boolean documentMode()
This property holds Whether or not the tab bar is rendered in a mode suitable for the main window. This property is used as a hint for styles to draw the tabs in a different way then they would normally look in a tab widget. On Mac OS X this will look similar to the tabs in Safari or Leopard's Terminal.app.

See also:
QTabWidget::documentMode.


drawBase

public final boolean drawBase()
This property defines whether or not tab bar should draw its base. If true then QTabBar draws a base in relation to the styles overlab. Otherwise only the tabs are drawn.

See also:
QStyle::pixelMetric(), QStyle::PM_TabBarBaseOverlap , and QStyleOptionTabBarBaseV2.


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 dependent.

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


expanding

public final boolean expanding()
This property holds When expanding is true QTabBar will expand the tabs to use the empty space. By default the value is true.

See also:
QTabWidget::documentMode.


iconSize

public final QSize iconSize()
This property holds The size for icons in the tab bar. The default value is style-dependent. iconSize is a maximum size; icons that are smaller are not scaled up.

See also:
QTabWidget::iconSize.


insertTab

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

Inserts a new tab with icon icon and text text at position index. If index is out of range, the new tab is appended. Returns the new tab's index.

If the QTabBar was empty before this function is called, the inserted tab becomes the current tab.

Inserting a new tab at an index less than or equal to the current index will increment the current index, but keep the current tab.


insertTab

public final int insertTab(int index,
                           java.lang.String text)
Inserts a new tab with text text at position index. If index is out of range, the new tab is appened. Returns the new tab's index.


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 tab at position index is enabled; otherwise returns false.


moveTab

public final void moveTab(int from,
                          int to)
Moves the item at index position from to index position to.

See also:
tabMoved() , and tabLayoutChange().


removeTab

public final void removeTab(int index)
Removes the tab at position index.

See also:
SelectionBehavior .


selectionBehaviorOnRemove

public final QTabBar.SelectionBehavior selectionBehaviorOnRemove()
This property holds What tab should be set as current when removeTab is called if the removed tab is also the current tab. By default the value is SelectRightTab .

See also:
removeTab().


setCurrentIndex

public final void setCurrentIndex(int index)
This property holds the index of the tab bar's visible tab. The current index is -1 if there is no current tab.


setDocumentMode

public final void setDocumentMode(boolean set)
This property holds Whether or not the tab bar is rendered in a mode suitable for the main window. This property is used as a hint for styles to draw the tabs in a different way then they would normally look in a tab widget. On Mac OS X this will look similar to the tabs in Safari or Leopard's Terminal.app.

See also:
QTabWidget::documentMode.


setDrawBase

public final void setDrawBase(boolean drawTheBase)
This property defines whether or not tab bar should draw its base. If true then QTabBar draws a base in relation to the styles overlab. Otherwise only the tabs are drawn.

See also:
QStyle::pixelMetric(), QStyle::PM_TabBarBaseOverlap , and QStyleOptionTabBarBaseV2.


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 dependent.

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


setExpanding

public final void setExpanding(boolean enabled)
This property holds When expanding is true QTabBar will expand the tabs to use the empty space. By default the value is true.

See also:
QTabWidget::documentMode.


setIconSize

public final void setIconSize(QSize size)
This property holds The size for icons in the tab bar. The default value is style-dependent. iconSize is a maximum size; icons that are smaller are not scaled up.

See also:
QTabWidget::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;


setSelectionBehaviorOnRemove

public final void setSelectionBehaviorOnRemove(QTabBar.SelectionBehavior behavior)
This property holds What tab should be set as current when removeTab is called if the removed tab is also the current tab. By default the value is SelectRightTab .

See also:
removeTab().


setShape

public final void setShape(QTabBar.Shape shape)
This property holds the shape of the tabs in the tab bar. Possible values for this property are described by the Shape enum.


setTabButton

public final void setTabButton(int index,
                               QTabBar.ButtonPosition position,
                               QWidget widget)
Sets widget on the tab index. The widget is placed on the left or right hand side depending upon the position.

Any previously set widget in position is hidden.

The tab bar will take ownership of the widget and so all widgets set here will be deleted by the tab bar when it is destroyed unless you separately reparent the widget after setting some other widget (or 0).

See also:
tabButton(), and tabsClosable().


setTabData

public final void setTabData(int index,
                             java.lang.Object data)
Sets the data of the tab at position index to data.

See also:
tabData().


setTabEnabled

public final void setTabEnabled(int index,
                                boolean arg__2)
If enabled is true then the tab at position index is enabled; otherwise the item at position index is disabled.

See also:
isTabEnabled().


setTabIcon

public final void setTabIcon(int index,
                             QIcon icon)
Sets the icon of the tab at position index to icon.

See also:
tabIcon().


setTabText

public final void setTabText(int index,
                             java.lang.String text)
Sets the text of the tab at position index to text.

See also:
tabText().


setTabTextColor

public final void setTabTextColor(int index,
                                  QColor color)
Sets the color of the text in the tab with the given index to the specified color.

If an invalid color is specified, the tab will use the QTabBar foreground role instead.

See also:
tabTextColor().


setTabToolTip

public final void setTabToolTip(int index,
                                java.lang.String tip)
Sets the tool tip of the tab 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 of the tab at position index to text.

See also:
tabWhatsThis().


setTabsClosable

public final void setTabsClosable(boolean closable)
This property holds Whether or not a tab bar should place close buttons on each tab. When tabsClosable is set to true a close button will appear on the tab on either the left or right hand side depending upon the style. When the button is clicked the tab the signal tabCloseRequested will be emitted.

By default the value is false.

See also:
setTabButton(), and tabRemoved().


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, QTabWidget::usesScrollButtons, and QStyle::SH_TabBar_PreferNoArrows .


shape

public final QTabBar.Shape shape()
This property holds the shape of the tabs in the tab bar. Possible values for this property are described by the Shape enum.


tabAt

public final int tabAt(QPoint pos)
Returns the index of the tab that covers position or -1 if no tab covers position;


tabButton

public final QWidget tabButton(int index,
                               QTabBar.ButtonPosition position)
Returns the widget set a tab index and position or 0 if one is not set.

See also:
setTabButton().


tabData

public final java.lang.Object tabData(int index)
Returns the datad of the tab at position index, or a null variant if index is out of range.

See also:
setTabData().


tabIcon

public final QIcon tabIcon(int index)
Returns the icon of the tab at position index, or a null icon if index is out of range.

See also:
setTabIcon().


tabRect

public final QRect tabRect(int index)
Returns the visual rectangle of the of the tab at position index, or a null rectangle if index is out of range.


tabText

public final java.lang.String tabText(int index)
Returns the text of the tab at position index, or an empty string if index is out of range.

See also:
setTabText().


tabTextColor

public final QColor tabTextColor(int index)
Returns the text color of the tab with the given index, or a invalid color if index is out of range.

See also:
setTabTextColor().


tabToolTip

public final java.lang.String tabToolTip(int index)
Returns the tool tip of the tab at position index, or an empty string if index is out of range.

See also:
setTabToolTip().


tabWhatsThis

public final java.lang.String tabWhatsThis(int index)
Returns the What's This help text of the tab at position index, or an empty string if index is out of range.

See also:
setTabWhatsThis().


tabsClosable

public final boolean tabsClosable()
This property holds Whether or not a tab bar should place close buttons on each tab. When tabsClosable is set to true a close button will appear on the tab on either the left or right hand side depending upon the style. When the button is clicked the tab the signal tabCloseRequested will be emitted.

By default the value is false.

See also:
setTabButton(), and tabRemoved().


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, QTabWidget::usesScrollButtons, and QStyle::SH_TabBar_PreferNoArrows .


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().


tabLayoutChange

protected void tabLayoutChange()
This virtual handler is called whenever the tab layout changes.

See also:
tabRect().


tabRemoved

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

See also:
tabInserted().


tabSizeHint

protected QSize tabSizeHint(int index)
Returns the size hint for the tab at position index.


initStyleOption

public final void initStyleOption(QStyleOptionTab option,
                                  int tabIndex)
Initialize option with the values from the tab at tabIndex. This method is useful for subclasses when they need a QStyleOptionTab or QStyleOptionTabV2, but don't want to fill in all the information themselves. This function will check the version of the QStyleOptionTab and fill in the additional values for a QStyleOptionTabV2.