QStyleOptionProgressBarV2 Class

The QStyleOptionProgressBarV2 class is used to describe the parameters necessary for drawing a progress bar in Qt 4.1 or above. 更多...

頭: #include <QStyleOptionProgressBarV2>
Since: Qt 4.1
繼承: QStyleOptionProgressBar

公共類型

enum StyleOptionType { Type }
enum StyleOptionVersion { Version }

公共函數

QStyleOptionProgressBarV2 ()
QStyleOptionProgressBarV2 (const QStyleOptionProgressBar & other )
QStyleOptionProgressBarV2 (const QStyleOptionProgressBarV2 & other )
QStyleOptionProgressBarV2 & operator= (const QStyleOptionProgressBar & other )

公共變量

bool bottomToTop
bool invertedAppearance
Qt::Orientation orientation

詳細描述

The QStyleOptionProgressBarV2 class is used to describe the parameters necessary for drawing a progress bar in Qt 4.1 or above.

An instance of this class has type SO_ProgressBar and version 2.

類型內部使用通過 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 (),通常不需要校驗它。

If you create your own QStyle subclass, you should handle both QStyleOptionProgressBar and QStyleOptionProgressBarV2 . One way to achieve this is to use the QStyleOptionProgressBarV2 copy constructor. For example:

    if (const QStyleOptionProgressBar *progressBarOption =
           qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
        QStyleOptionProgressBarV2 progressBarV2(*progressBarOption);
        // draw the progress bar using progressBarV2
    }
					

In the example above: If the progressBarOption 's version is 1, the extra members ( orientation , invertedAppearance ,和 bottomToTop ) are set to default values for progressBarV2 。若 progressBarOption 's version is 2, the constructor will simply copy the extra members to progressBarV2.

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

另請參閱 QStyleOptionProgressBar and QStyleOption .

成員類型文檔編製

enum QStyleOptionProgressBarV2:: StyleOptionType

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

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

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

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

常量 描述
QStyleOptionProgressBarV2::Version 2 2

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

另請參閱 StyleOptionType .

成員函數文檔編製

QStyleOptionProgressBarV2:: QStyleOptionProgressBarV2 ()

構造 QStyleOptionProgressBarV2 , initializing he members variables to their default values.

QStyleOptionProgressBarV2:: QStyleOptionProgressBarV2 (const QStyleOptionProgressBar & other )

構造副本為 other style option which can be either of the QStyleOptionProgressBar and QStyleOptionProgressBarV2 類型。

other style option's version is 1, the extra members ( orientation , invertedAppearance ,和 bottomToTop ) are set to default values for the new style option. If other 's version is 2, the extra members are simply copied.

另請參閱 version .

QStyleOptionProgressBarV2:: QStyleOptionProgressBarV2 (const QStyleOptionProgressBarV2 & other )

構造副本為 other 樣式選項。

QStyleOptionProgressBarV2 & QStyleOptionProgressBarV2:: operator= (const QStyleOptionProgressBar & other )

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

other style option's version is 1, the extra members ( orientation , invertedAppearance ,和 bottomToTop ) are set to default values for this style option. If other 's version is 2, the extra members are simply copied to this style option.

成員變量文檔編製

bool QStyleOptionProgressBarV2:: bottomToTop

This variable holds whether the text reads from bottom to top when the progress bar is vertical.

默認值為 false。

另請參閱 QProgressBar::textDirection .

bool QStyleOptionProgressBarV2:: invertedAppearance

This variable holds whether the progress bar's appearance is inverted.

默認值為 false。

另請參閱 QProgressBar::invertedAppearance .

Qt::Orientation QStyleOptionProgressBarV2:: orientation

This variable holds the progress bar's orientation (horizontal or vertical); the default orentation is Qt::Horizontal.

另請參閱 QProgressBar::orientation .