QStyleOptionViewItemV2 Class

The QStyleOptionViewItemV2 class is used to describe the parameters necessary for drawing a frame in Qt 4.2 or above. 更多...

頭: #include <QStyleOptionViewItemV2>
Since: Qt 4.2
繼承: QStyleOptionViewItem
繼承者: QStyleOptionViewItemV3

公共類型

enum StyleOptionVersion { Version }
enum ViewItemFeature { None, WrapText, Alternate, HasCheckIndicator, HasDisplay, HasDecoration }
flags ViewItemFeatures

公共函數

QStyleOptionViewItemV2 ()
QStyleOptionViewItemV2 (const QStyleOptionViewItemV2 & other )
QStyleOptionViewItemV2 (const QStyleOptionViewItem & other )
QStyleOptionViewItemV2 & operator= (const QStyleOptionViewItem & other )

公共變量

ViewItemFeatures features

詳細描述

The QStyleOptionViewItemV2 class is used to describe the parameters necessary for drawing a frame in Qt 4.2 or above.

QStyleOptionViewItemV2 繼承 QStyleOptionViewItem .

An instance of the QStyleOptionViewItemV2 class has type SO_ViewItem and version 2. 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 (),通常不需要校驗它。

QStyleOptionFrameV2 's detailed description for a discussion of how to handle "V2" classes.

另請參閱 QStyleOptionViewItem and QStyleOption .

成員類型文檔編製

enum QStyleOptionViewItemV2:: StyleOptionVersion

This enum is used to hold information about the version of the style option, and is defined for each QStyleOption 子類。

常量 描述
QStyleOptionViewItemV2::Version 2 2

版本的使用通過 QStyleOption 子類以實現擴展在不破壞兼容性的情況下。若使用 qstyleoption_cast (),通常不需要校驗它。

另請參閱 StyleOptionType .

enum QStyleOptionViewItemV2:: ViewItemFeature
flags QStyleOptionViewItemV2:: ViewItemFeatures

This enum describes the different types of features an item can have.

常量 描述
QStyleOptionViewItemV2::None 0x00 指示正常項。
QStyleOptionViewItemV2::WrapText 0x01 Indicates an item with wrapped text.
QStyleOptionViewItemV2::Alternate 0x02 Indicates that the item's background is rendered using alternateBase.
QStyleOptionViewItemV2::HasCheckIndicator 0x04 Indicates that the item has a check state indicator.
QStyleOptionViewItemV2::HasDisplay 0x08 Indicates that the item has a display role.
QStyleOptionViewItemV2::HasDecoration 0x10 Indicates that the item has a decoration role.

The ViewItemFeatures type is a typedef for QFlags <ViewItemFeature>. It stores an OR combination of ViewItemFeature values.

成員函數文檔編製

QStyleOptionViewItemV2:: QStyleOptionViewItemV2 ()

構造 QStyleOptionViewItemV2 對象。

QStyleOptionViewItemV2:: QStyleOptionViewItemV2 (const QStyleOptionViewItemV2 & other )

構造副本為 other .

QStyleOptionViewItemV2:: QStyleOptionViewItemV2 (const QStyleOptionViewItem & other )

構造 QStyleOptionViewItemV2 copy of the other style option which can be either of the QStyleOptionViewItemV2 or QStyleOptionViewItem 類型。

other style option's version is 1, the new style option's ViewItemFeature value is set to QStyleOptionViewItemV2::None . If its version is 2, its ViewItemFeature value is simply copied to the new style option.

另請參閱 version .

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

賦值 other style option to this style option. The other style option can be either of the QStyleOptionViewItemV2 or QStyleOptionViewItem 類型。

other style option's version is 1, this style option's ViewItemFeature value is set to QStyleOptionViewItemV2::None . If its version is 2, its ViewItemFeature value is simply copied to this style option.

成員變量文檔編製

ViewItemFeatures QStyleOptionViewItemV2:: features

This variable holds a bitwise OR of the features that describe this view item.

另請參閱 ViewItemFeature .