The QStyleOptionTab class is used to describe the parameters for drawing a tab bar. More...
#include <QStyleOptionTab>
Inherits: QStyleOption.
Inherited by: QStyleOptionTabV2.
enum | CornerWidget { NoCornerWidgets, LeftCornerWidget, RightCornerWidget } |
flags | CornerWidgets |
enum | SelectedPosition { NotAdjacent, NextIsSelected, PreviousIsSelected } |
enum | StyleOptionType { Type } |
enum | StyleOptionVersion { Version } |
enum | TabPosition { Beginning, Middle, End, OnlyOneTab } |
QStyleOptionTab () | |
QStyleOptionTab ( const QStyleOptionTab & other ) |
CornerWidgets | cornerWidgets |
QIcon | icon |
TabPosition | position |
int | row |
SelectedPosition | selectedPosition |
QTabBar::Shape | shape |
QString | text |
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 do not 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.
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.
This enum describes the position of the selected tab. Some styles need to draw a tab differently depending on whether or not it is adjacent to the selected tab.
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.
This enum is used to hold information about the type of the style option, and is defined for each QStyleOption subclass.
Constant | Value | Description |
---|---|---|
QStyleOptionTab::Type | SO_Tab | The type of style option provided (SO_Tab for this class). |
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.
See also StyleOptionVersion.
This enum is used to hold information about the version of the style option, and is defined for each QStyleOption subclass.
Constant | Value | Description |
---|---|---|
QStyleOptionTab::Version | 1 | 1 |
The version is used by QStyleOption subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast(), you normally do not need to check it.
See also StyleOptionType.
This enum describes the position of the tab.
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.
Constructs a QStyleOptionTab object, initializing the members variables to their default values.
Constructs a copy of the other style option.
This variable holds an OR combination of CornerWidget values indicating the corner widgets of the tab bar.
The default value is NoCornerWidgets.
See also CornerWidget.
This variable holds the icon for the tab.
The default value is an empty icon, i.e. an icon with neither a pixmap nor a filename.
This variable holds the position of the tab in the tab bar.
The default value is Beginning, i.e. the tab is the first tab in the tab bar.
This variable holds which row the tab is currently in.
The default value is 0, indicating the front row. Currently this property can only be 0.
This variable holds the position of the selected tab in relation to this tab.
The default value is NotAdjacent, i.e. the tab is not adjacent to a selected tab nor is it the selected tab.
This variable holds the tab shape used to draw the tab; by default QTabBar::RoundedNorth.
See also QTabBar::Shape.
This variable holds the text of the tab.
The default value is an empty string.
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.