QStyleOptionProgressBar 類

The QStyleOptionProgressBar class is used to describe the parameters necessary for drawing a progress bar. 更多...

頭: #include <QStyleOptionProgressBar>
qmake: QT += widgets
繼承: QStyleOption

公共類型

enum StyleOptionType { Type }
enum StyleOptionVersion { Version }

公共函數

QStyleOptionProgressBar ()
QStyleOptionProgressBar (const QStyleOptionProgressBar & other )

公共變量

bool bottomToTop
bool invertedAppearance
int maximum
int minimum
int progress
QString text
Qt::Alignment textAlignment
bool textVisible

詳細描述

The QStyleOptionProgressBar class is used to describe the parameters necessary for drawing a progress bar.

An instance of the QStyleOptionProgressBar 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 (),通常不需要校驗它。

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

另請參閱 QStyleOption .

成員類型文檔編製

enum QStyleOptionProgressBar:: StyleOptionType

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

常量 描述
QStyleOptionProgressBar::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 QStyleOptionProgressBar:: StyleOptionVersion

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

常量 描述
QStyleOptionProgressBar::Version 2 2

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

另請參閱 StyleOptionType .

成員函數文檔編製

QStyleOptionProgressBar:: QStyleOptionProgressBar ()

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

QStyleOptionProgressBar:: QStyleOptionProgressBar (const QStyleOptionProgressBar & other )

構造副本為 other 樣式選項。

成員變量文檔編製

bool QStyleOptionProgressBar:: bottomToTop

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

默認值為 false。

另請參閱 QProgressBar::textDirection .

bool QStyleOptionProgressBar:: invertedAppearance

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

默認值為 false。

另請參閱 QProgressBar::invertedAppearance .

int QStyleOptionProgressBar:: maximum

This variable holds the maximum value for the progress bar

This is the maximum value in the progress bar. The default value is 0.

另請參閱 QProgressBar::maximum .

int QStyleOptionProgressBar:: minimum

This variable holds the minimum value for the progress bar

This is the minimum value in the progress bar. The default value is 0.

另請參閱 QProgressBar::minimum .

int QStyleOptionProgressBar:: progress

This variable holds the current progress for the progress bar

The current progress. A value of QStyleOptionProgressBar::minimum - 1 indicates that the progress hasn't started yet. The default value is 0.

另請參閱 QProgressBar::value .

QString QStyleOptionProgressBar:: text

This variable holds the text for the progress bar

The progress bar text is usually just the progress expressed as a string. An empty string indicates that the progress bar has not started yet. The default value is an empty string.

另請參閱 QProgressBar::text .

Qt::Alignment QStyleOptionProgressBar:: textAlignment

This variable holds the text alignment for the text in the QProgressBar

This can be used as a guide on where the text should be in the progress bar. The default value is Qt::AlignLeft .

bool QStyleOptionProgressBar:: textVisible

This variable holds a flag indicating whether or not text is visible

If this flag is true then the text is visible. Otherwise, the text is not visible. The default value is false.

另請參閱 QProgressBar::textVisible .