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.