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.