The QStyleOptionViewItemV4 class is used to describe the parameters necessary for drawing a frame in Qt 4.4 or above. 更多...
| 頭: | #include <QStyleOptionViewItemV4> |
| Since: | Qt 4.4 |
| 繼承: | QStyleOptionViewItemV3 |
| enum | StyleOptionVersion { Version } |
| enum | ViewItemPosition { Invalid, Beginning, Middle, End, OnlyOne } |
| QStyleOptionViewItemV4 () | |
| QStyleOptionViewItemV4 (const QStyleOptionViewItemV4 & other ) | |
| QStyleOptionViewItemV4 (const QStyleOptionViewItem & other ) | |
| QStyleOptionViewItemV4 & | operator= (const QStyleOptionViewItem & other ) |
| QBrush | backgroundBrush |
| Qt::CheckState | checkState |
| QIcon | icon |
| QModelIndex | index |
| QString | text |
| ViewItemPosition | viewItemPosition |
The QStyleOptionViewItemV4 class is used to describe the parameters necessary for drawing a frame in Qt 4.4 or above.
QStyleOptionViewItemV4 繼承 QStyleOptionViewItemV3 .
An instance of the QStyleOptionViewItemV4 class has type SO_ViewItem and version 4. 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 (),通常不需要校驗它。
見 QStyleOptionViewItemV3 's detailed description for a discussion of how to handle "V3" classes.
另請參閱 QStyleOptionViewItem and QStyleOption .
This enum is used to hold information about the version of the style option, and is defined for each QStyleOption 子類。
| 常量 | 值 | 描述 |
|---|---|---|
QStyleOptionViewItemV4::Version
|
4
|
4 |
版本的使用通過 QStyleOption 子類以實現擴展在不破壞兼容性的情況下。若使用 qstyleoption_cast (),通常不需要校驗它。
另請參閱 StyleOptionType .
This enum is used to represent the placement of the item on a row. This can be used to draw items differently depending on their placement, for example by putting rounded edges at the beginning and end, and straight edges in between.
| 常量 | 值 | 描述 |
|---|---|---|
QStyleOptionViewItemV4::Invalid
|
0
|
The ViewItemPosition is unknown and should be disregarded. |
QStyleOptionViewItemV4::Beginning
|
1
|
The item appears at the beginning of the row. |
QStyleOptionViewItemV4::Middle
|
2
|
The item appears in the middle of the row. |
QStyleOptionViewItemV4::End
|
3
|
The item appears at the end of the row. |
QStyleOptionViewItemV4::OnlyOne
|
4
|
The item is the only one on the row, and is therefore both at the beginning and the end. |
構造 QStyleOptionViewItemV4 對象。
構造副本為 other .
構造 QStyleOptionViewItemV4 copy of the other style option which can be either of the QStyleOptionViewItemV3 or QStyleOptionViewItem 類型。
另請參閱 version .
賦值 other style option to this style option. The other style option can be either of the QStyleOptionViewItemV3 or QStyleOptionViewItem 類型。
The QBrush that should be used to paint the view items background.
If this view item is checkable, i.e., ViewItemFeature::HasCheckIndicator is true,
checkState
is true if the item is checked; otherwise, it is false.
視圖項要繪製的圖標 (若有的話)。
要繪製的模型索引。
The text (if any) to be drawn in the view item.
Gives the position of this view item relative to other items. See the ViewItemPosition enum for the details.