QStyleOptionTab 类是用于绘制选项卡栏的描述参数。 更多...
头: | #include <QStyleOptionTab> |
CMake: |
find_package(Qt6 COMPONENTS Widgets REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Widgets) |
qmake: | QT += widgets |
继承: | QStyleOption |
enum | CornerWidget { NoCornerWidgets, LeftCornerWidget, RightCornerWidget } |
flags | CornerWidgets |
enum | SelectedPosition { NotAdjacent, NextIsSelected, PreviousIsSelected } |
enum | StyleOptionType { Type } |
enum | StyleOptionVersion { Version } |
enum | TabFeature { None, HasFrame } |
flags | TabFeatures |
enum | TabPosition { Beginning, Middle, End, OnlyOneTab } |
QStyleOptionTab (const QStyleOptionTab & other ) | |
QStyleOptionTab () |
QStyleOptionTab::CornerWidgets | cornerWidgets |
bool | documentMode |
QIcon | icon |
QSize | iconSize |
QSize | leftButtonSize |
QStyleOptionTab::TabPosition | position |
QSize | rightButtonSize |
int | row |
QStyleOptionTab::SelectedPosition | selectedPosition |
QTabBar::Shape | shape |
int | tabIndex |
QString | text |
QStyleOptionTab 类用于绘制几种内置 Qt Widget 包括 QTabBar 和面板为 QTabWidget .
QStyleOptionTab 类实例拥有 type SO_Tab and version 3. The type is used internally by QStyleOption ,其子类,和 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 子类以实现扩展在不破坏兼容性的情况下。若使用 qstyleoption_cast (),通常不需要校验它。
出于性能原因,有很少成员函数,且对成员变量的访问是直接的 (即:使用
.
or
->
运算符)。这使结构易于使用并强调这些只需通过样式函数使用参数。
对于可以如何使用样式选项的演示范例,见 样式 范例。
另请参阅 QStyleOption .
这些标志指示选项卡的角落小部件。
常量 | 值 | 描述 |
---|---|---|
QStyleOptionTab::NoCornerWidgets
|
0x00
|
没有角落 Widget |
QStyleOptionTab::LeftCornerWidget
|
0x01
|
左上角 Widget |
QStyleOptionTab::RightCornerWidget
|
0x02
|
右上角 Widget |
The CornerWidgets type is a typedef for QFlags <CornerWidget>. It stores an OR combination of CornerWidget values.
另请参阅 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.
常量 | 值 | 描述 |
---|---|---|
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. |
另请参阅 selectedPosition .
This enum is used to hold information about the type of the style option, and is defined for each QStyleOption 子类。
常量 | 值 | 描述 |
---|---|---|
QStyleOptionTab::Type
|
SO_Tab
|
提供样式选项的类型 ( SO_Tab 对于此类)。 |
类型内部使用通过 QStyleOption ,其子类,和 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.
另请参阅 StyleOptionVersion .
This enum is used to hold information about the version of the style option, and is defined for each QStyleOption 子类。
常量 | 值 | 描述 |
---|---|---|
QStyleOptionTab::Version
|
1
|
3 |
版本的使用通过 QStyleOption 子类以实现扩展在不破坏兼容性的情况下。若使用 qstyleoption_cast (),通常不需要校验它。
另请参阅 StyleOptionType .
Describes the various features that a tab button can have.
常量 | 值 | 描述 |
---|---|---|
QStyleOptionTab::None
|
0x00
|
A normal tab button. |
QStyleOptionTab::HasFrame
|
0x01
|
The tab button is positioned on a tab frame |
The TabFeatures type is a typedef for QFlags <TabFeature>. It stores an OR combination of TabFeature values.
另请参阅 QStyleOptionToolBar::features .
此枚举描述选项卡的位置。
常量 | 值 | 描述 |
---|---|---|
QStyleOptionTab::Beginning
|
0
|
选项卡是选项卡栏中的第一选项卡。 |
QStyleOptionTab::Middle
|
1
|
选项卡既不是选项卡栏中的第一选项卡,也不是最后选项卡。 |
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. |
另请参阅 position .
构造副本为 other 样式选项。
Constructs a QStyleOptionTab object, initializing the members variables to their default values.
This variable holds an OR combination of CornerWidget values indicating the corner widgets of the tab bar
默认值为 NoCornerWidgets .
另请参阅 CornerWidget .
This variable holds whether the tabbar is in document mode.
默认值为 false;
This variable holds the icon for the tab
默认值为空图标 (即:图标既没有像素图,也没有文件名)。
This variable holds the size for the icons
默认值为 QSize (-1, -1), i.e. an invalid size; use QStyle::pixelMetric () to find the default icon size for tab bars.
另请参阅 QTabBar::iconSize ().
This variable holds the size for the left widget on the tab.
默认值为 QSize (-1, -1), i.e. an invalid size;
This variable holds the position of the tab in the tab bar
默认值为 Beginning , i.e. the tab is the first tab in the tab bar.
This variable holds the size for the right widget on the tab.
默认值为 QSize (-1, -1), i.e. an invalid size;
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
默认值为 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
另请参阅 QTabBar::Shape .
This variable holds the index for the tab being represented.
The default value is -1, i.e. a tab not on a tabbar;
此变量保持选项卡文本
默认值为空字符串。