QStyleOptionQ3ListViewItem Class

The QStyleOptionQ3ListViewItem class is used to describe an item drawn in a Q3ListView . 更多...

頭: #include <QStyleOptionQ3ListViewItem>
繼承: QStyleOption

公共類型

enum Q3ListViewItemFeature { None, Expandable, MultiLine, Visible, ParentControl }
flags Q3ListViewItemFeatures
enum StyleOptionType { Type }
enum StyleOptionVersion { Version }

公共函數

QStyleOptionQ3ListViewItem ()
QStyleOptionQ3ListViewItem (const QStyleOptionQ3ListViewItem & other )

公共變量

int childCount
Q3ListViewItemFeatures features
int height
int itemY
int totalHeight

詳細描述

The QStyleOptionQ3ListViewItem class is used to describe an item drawn in a Q3ListView .

This class is used for drawing the compatibility Q3ListView 's items. It is not recommended for new classes .

QStyleOptionQ3ListViewItem contains all the information that QStyle functions need to draw the Q3ListView 項。

For performance reasons, the access to the member variables is direct (i.e., using the . or -> operator). This low-level feel makes the structures straightforward to use and emphasizes that these are simply parameters used by the style functions.

對於可以如何使用樣式選項的演示範例,見 樣式 範例。

另請參閱 QStyleOption , QStyleOptionQ3ListView ,和 Q3ListViewItem .

成員類型文檔編製

enum QStyleOptionQ3ListViewItem:: Q3ListViewItemFeature
flags QStyleOptionQ3ListViewItem:: Q3ListViewItemFeatures

This enum describes the features a list view item can have.

常量 描述
QStyleOptionQ3ListViewItem::None 0x00 A standard item.
QStyleOptionQ3ListViewItem::Expandable 0x01 The item has children that can be shown.
QStyleOptionQ3ListViewItem::MultiLine 0x02 The item is more than one line tall.
QStyleOptionQ3ListViewItem::Visible 0x04 The item is visible.
QStyleOptionQ3ListViewItem::ParentControl 0x08 The item's parent is a type of item control ( Q3CheckListItem::Controller ).

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

另請參閱 features , Q3ListViewItem::isVisible (), Q3ListViewItem::multiLinesEnabled (),和 Q3ListViewItem::isExpandable ().

enum QStyleOptionQ3ListViewItem:: StyleOptionType

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

常量 描述
QStyleOptionQ3ListViewItem::Type SO_Q3ListViewItem 提供樣式選項的類型 ( SO_Q3ListViewItem 對於此類)。

類型內部使用通過 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.

另請參閱 StyleOptionVersion .

enum QStyleOptionQ3ListViewItem:: StyleOptionVersion

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

常量 描述
QStyleOptionQ3ListViewItem::Version 1 1

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

另請參閱 StyleOptionType .

成員函數文檔編製

QStyleOptionQ3ListViewItem:: QStyleOptionQ3ListViewItem ()

構造 QStyleOptionQ3ListViewItem , initializing the members variables to their default values.

QStyleOptionQ3ListViewItem:: QStyleOptionQ3ListViewItem (const QStyleOptionQ3ListViewItem & other )

構造副本為 other 樣式選項。

成員變量文檔編製

int QStyleOptionQ3ListViewItem:: childCount

This variable holds the number of children the item has.

Q3ListViewItemFeatures QStyleOptionQ3ListViewItem:: features

This variable holds the features for this item.

This variable is a bitwise OR of the features of the item. The deafult value is None .

另請參閱 Q3ListViewItemFeature .

int QStyleOptionQ3ListViewItem:: height

This variable holds the height of the item.

This doesn't include the height of the item's children. The default height is 0.

另請參閱 Q3ListViewItem::height ().

int QStyleOptionQ3ListViewItem:: itemY

This variable holds the Y-coordinate for the item.

默認值為 0。

另請參閱 Q3ListViewItem::itemPos ().

int QStyleOptionQ3ListViewItem:: totalHeight

This variable holds the total height of the item, including its children.

The default total height is 0.

另請參閱 Q3ListViewItem::totalHeight ().