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 .
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 .
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 , initializing he members variables to their default values.
构造副本为 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 .
构造副本为 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.
This variable holds whether the text reads from bottom to top when the progress bar is vertical.
默认值为 false。
另请参阅 QProgressBar::textDirection .
This variable holds whether the progress bar's appearance is inverted.
默认值为 false。
另请参阅 QProgressBar::invertedAppearance .
This variable holds the progress bar's orientation (horizontal or vertical); the default orentation is Qt::Horizontal.
另请参阅 QProgressBar::orientation .