QStyleOptionHeader 類是用於繪製 Header (頭) 的描述參數。 更多...
| 頭: |
#include <QStyleOptionHeader>
|
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
|
| qmake: |
QT += widgets
|
| 繼承: | QStyleOption |
| 繼承者: |
| enum | SectionPosition { Beginning, Middle, End, OnlyOneSection } |
| enum | SelectedPosition { NotAdjacent, NextIsSelected, PreviousIsSelected, NextAndPreviousAreSelected } |
| enum | SortIndicator { None, SortUp, SortDown } |
| enum | StyleOptionType { Type } |
| enum | StyleOptionVersion { Version } |
| QStyleOptionHeader () | |
| QStyleOptionHeader (const QStyleOptionHeader & other ) |
| QIcon | icon |
| Qt::Alignment | iconAlignment |
| Qt::Orientation | orientation |
| QStyleOptionHeader::SectionPosition | position |
| int | section |
| QStyleOptionHeader::SelectedPosition | selectedPosition |
| QStyleOptionHeader::SortIndicator | sortIndicator |
| QString | text |
| Qt::Alignment | textAlignment |
QStyleOptionHeader contains all the information that QStyle functions need to draw the item views' header pane, header sort arrow, and header label.
齣於性能原因,有很少成員函數,且對成員變量的訪問是直接的 (即:使用
.
or
->
運算符)。這使結構易於使用並強調這些隻需通過樣式函數使用參數。
另請參閱 QStyleOption .
This enum lets you know where the section's position is in relation to the other sections.
| 常量 | 值 | 描述 |
|---|---|---|
QStyleOptionHeader::Beginning
|
0
|
At the beginining of the header |
QStyleOptionHeader::Middle
|
1
|
In the middle of the header |
QStyleOptionHeader::End
|
2
|
At the end of the header |
QStyleOptionHeader::OnlyOneSection
|
3
|
Only one header section |
另請參閱 position .
This enum lets you know where the section's position is in relation to the selected section.
| 常量 | 值 | 描述 |
|---|---|---|
QStyleOptionHeader::NotAdjacent
|
0
|
Not adjacent to the selected section |
QStyleOptionHeader::NextIsSelected
|
1
|
The next section is selected |
QStyleOptionHeader::PreviousIsSelected
|
2
|
The previous section is selected |
QStyleOptionHeader::NextAndPreviousAreSelected
|
3
|
Both the next and previous section are selected |
另請參閱 selectedPosition .
Indicates which direction the sort indicator should be drawn
| 常量 | 值 | 描述 |
|---|---|---|
QStyleOptionHeader::None
|
0
|
No sort indicator is needed |
QStyleOptionHeader::SortUp
|
1
|
Draw an up indicator |
QStyleOptionHeader::SortDown
|
2
|
Draw a down indicator |
另請參閱 sortIndicator .
This enum is used to hold information about the type of the style option, and is defined for each QStyleOption 子類。
| 常量 | 值 | 描述 |
|---|---|---|
QStyleOptionHeader::Type
|
SO_Header
|
提供樣式選項的類型 ( SO_Header 對於此類)。 |
類型內部使用通過 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 子類。
| 常量 | 值 | 描述 |
|---|---|---|
QStyleOptionHeader::Version
|
1
|
1 |
版本的使用通過 QStyleOption 子類以實現擴展在不破壞兼容性的情況下。若使用 qstyleoption_cast (),通常不需要校驗它。
另請參閱 StyleOptionType .
Constructs a QStyleOptionHeader, initializing the members variables to their default values.
構造副本為 other 樣式選項。
This variable holds the icon of the header
默認值為空圖標 (即:圖標既沒有像素圖,也沒有文件名)。
This variable holds the alignment flags for the icon of the header
默認值為 Qt::AlignLeft .
This variable holds the header's orientation (horizontal or vertical)
The default orientation is Qt::Horizontal
This variable holds the section's position in relation to the other sections
默認值為 QStyleOptionHeader::Beginning .
This variable holds which section of the header is being painted
默認值為 0。
This variable holds the section's position in relation to the selected section
默認值為 QStyleOptionHeader::NotAdjacent
This variable holds the direction the sort indicator should be drawn
默認值為 QStyleOptionHeader::None .
This variable holds the text of the header
默認值為空字符串。
This variable holds the alignment flags for the text of the header
默認值為 Qt::AlignLeft .