QStyleOptionProgressBar 类

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

头: #include <QStyleOptionProgressBar>
继承: QStyleOption
继承者: QStyleOptionProgressBarV2

公共类型

enum StyleOptionType { Type }
enum StyleOptionVersion { Version }

公共函数

QStyleOptionProgressBar ()
QStyleOptionProgressBar (const QStyleOptionProgressBar & other )

公共变量

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.

Since Qt 4.1, Qt uses the QStyleOptionProgressBarV2 subclass for drawing QProgressBar .

An instance of the QStyleOptionProgressBar class has type SO_ProgressBar and version 1.

类型内部使用通过 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 .

对于可以如何使用样式选项的演示范例,见 样式 范例。

另请参阅 QStyleOptionProgressBarV2 and 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 1 1

版本的使用通过 QStyleOption 子类以实现扩展在不破坏兼容性的情况下。若使用 qstyleoption_cast (),通常不需要校验它。

另请参阅 StyleOptionType .

成员函数文档编制

QStyleOptionProgressBar:: QStyleOptionProgressBar ()

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

QStyleOptionProgressBar:: QStyleOptionProgressBar (const QStyleOptionProgressBar & other )

构造副本为 other 样式选项。

成员变量文档编制

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 .