QStyleOptionViewItemV4 Class

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 .

成员类型文档编制

enum QStyleOptionViewItemV4:: StyleOptionVersion

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 .

enum QStyleOptionViewItemV4:: ViewItemPosition

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:: QStyleOptionViewItemV4 ()

构造 QStyleOptionViewItemV4 对象。

QStyleOptionViewItemV4:: QStyleOptionViewItemV4 (const QStyleOptionViewItemV4 & other )

构造副本为 other .

QStyleOptionViewItemV4:: QStyleOptionViewItemV4 (const QStyleOptionViewItem & other )

构造 QStyleOptionViewItemV4 copy of the other style option which can be either of the QStyleOptionViewItemV3 or QStyleOptionViewItem 类型。

另请参阅 version .

QStyleOptionViewItemV4 & QStyleOptionViewItemV4:: operator= (const QStyleOptionViewItem & other )

赋值 other style option to this style option. The other style option can be either of the QStyleOptionViewItemV3 or QStyleOptionViewItem 类型。

成员变量文档编制

QBrush QStyleOptionViewItemV4:: backgroundBrush

The QBrush that should be used to paint the view items background.

Qt::CheckState QStyleOptionViewItemV4:: checkState

If this view item is checkable, i.e., ViewItemFeature::HasCheckIndicator is true, checkState is true if the item is checked; otherwise, it is false.

QIcon QStyleOptionViewItemV4:: icon

视图项要绘制的图标 (若有的话)。

QModelIndex QStyleOptionViewItemV4:: index

要绘制的模型索引。

QString QStyleOptionViewItemV4:: text

The text (if any) to be drawn in the view item.

ViewItemPosition QStyleOptionViewItemV4:: viewItemPosition

Gives the position of this view item relative to other items. See the ViewItemPosition enum for the details.