|  | Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |

# QStyleOptionTab Class Reference
[QtGui module]

The QStyleOptionTab class is used to describe the parameters for drawing a tab bar. More...

    #include <QStyleOptionTab>

Inherits QStyleOption.

Inherited by QStyleOptionTabV2.

- List of all members, including inherited members

### Public Types

- enum CornerWidget { NoCornerWidgets, LeftCornerWidget, RightCornerWidget }
- flags CornerWidgets
- enum SelectedPosition { NotAdjacent, NextIsSelected, PreviousIsSelected }
- enum TabPosition { Beginning, Middle, End, OnlyOneTab }

### Public Functions

- QStyleOptionTab ()
- QStyleOptionTab ( const QStyleOptionTab & other )

- 2 public functions inherited from QStyleOption

### Public Variables

- CornerWidgets cornerWidgets
- QIcon icon
- TabPosition position
- int row
- SelectedPosition selectedPosition
- QTabBar::Shape shape
- QString text

- 7 public variables inherited from QStyleOption

### Static Public Members

- const int Type
- const int Version

- 2 static public members inherited from QStyleOption

## Detailed Description

The QStyleOptionTab class is used to describe the parameters for drawing a tab bar.

The QStyleOptionTab class is used for drawing several built-in Qt widgets including QTabBar and the panel for QTabWidget. Note that to describe the parameters necessary for drawing a frame in Qt 4.1 or above, you must use the QStyleOptionFrameV2 subclass.

An instance of the QStyleOptiontabV2 class has type SO_Tab and version 1. The type is used internally by QStyleOption, its subclasses, and qstyleoption_cast() to determine the type of style option. In general you do not need to worry about this unless you want to create your own QStyleOption subclass and your own styles. The version is used by QStyleOption subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast(), you normally don't need to check it.

If you create your own QStyle subclass, you should handle both QStyleOptionTab and QStyleOptionTabV2.

For an example demonstrating how style options can be used, see the Styles example.

See also QStyleOptionTabV2 and QStyleOption.

## Member Type Documentation

### enum QStyleOptionTab::CornerWidget
flags QStyleOptionTab::CornerWidgets

These flags indicate the corner widgets in a tab.

Constant | Value | Description
--- | --- | ---
`QStyleOptionTab::NoCornerWidgets` | `0x00` | There are no corner widgets
`QStyleOptionTab::LeftCornerWidget` | `0x01` | Left corner widget
`QStyleOptionTab::RightCornerWidget` | `0x02` | Right corner widget

The CornerWidgets type is a typedef for QFlags<CornerWidget>. It stores an OR combination of CornerWidget values.

See also cornerWidgets.

### enum QStyleOptionTab::SelectedPosition

Constant | Value | Description
--- | --- | ---
`QStyleOptionTab::NotAdjacent` | `0` | The tab is not adjacent to a selected tab (or is the selected tab).
`QStyleOptionTab::NextIsSelected` | `1` | The next tab (typically the tab on the right) is selected.
`QStyleOptionTab::PreviousIsSelected` | `2` | The previous tab (typically the tab on the left) is selected.

See also selectedPosition.

### enum QStyleOptionTab::TabPosition

Constant | Value | Description
--- | --- | ---
`QStyleOptionTab::Beginning` | `0` | The tab is the first tab in the tab bar.
`QStyleOptionTab::Middle` | `1` | The tab is neither the first nor the last tab in the tab bar.
`QStyleOptionTab::End` | `2` | The tab is the last tab in the tab bar.
`QStyleOptionTab::OnlyOneTab` | `3` | The tab is both the first and the last tab in the tab bar.

See also position.

## Member Function Documentation

### QStyleOptionTab::QStyleOptionTab ()

Constructs a QStyleOptionTab object. The members variables are initialized to default values.

### QStyleOptionTab::QStyleOptionTab ( const QStyleOptionTab & other )

Constructs a copy of the other style option.

## Member Variable Documentation

### const int QStyleOptionTab::Type

Equals SO_Tab.

The type is used internally by QStyleOption, its subclasses, and qstyleoption_cast() to determine the type of style option. In general you do not need to worry about this unless you want to create your own QStyleOption subclass and your own styles.

### const int QStyleOptionTab::Version

Equals 1.

The version is used by QStyleOption subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast(), you normally don't need to check it.

### CornerWidgets QStyleOptionTab::cornerWidgets

This variable holds information on the cornerwidgets of the tab bar.

See also CornerWidget.

### QIcon QStyleOptionTab::icon

This variable holds the icon for the tab.

### TabPosition QStyleOptionTab::position

This variable holds the position of the tab in the tab bar.

### int QStyleOptionTab::row

This variable holds which row the tab is currently in.

0 indicates the front row.

Currently this property can only be 0.

### SelectedPosition QStyleOptionTab::selectedPosition

This variable holds the position of the selected tab in relation to this tab. Some styles need to draw a tab differently depending on whether or not it is adjacent to the selected tab.

### QTabBar::Shape QStyleOptionTab::shape

This variable holds the tab shape used to draw the tab.

See also QTabBar::Shape.

### QString QStyleOptionTab::text

This variable holds the text of the tab.