QWinTaskbarProgress Class

The QWinTaskbarProgress class represents a progress indicator in the Windows taskbar. 更多...

头文件: #include <QWinTaskbarProgress>
qmake: QT += winextras
开始支持版本: Qt 5.2
基类: QObject

属性

公有函数

QWinTaskbarProgress(QObject *parent = Q_NULLPTR)
~QWinTaskbarProgress()
bool isPaused() const
bool isStopped() const
bool isVisible() const
int maximum() const
int minimum() const
int value() const
  • 32 个公有函数继承自 QObject

公有槽函数

void hide()
void pause()
void reset()
void resume()
void setMaximum(int maximum)
void setMinimum(int minimum)
void setPaused(bool paused)
void setRange(int minimum, int maximum)
void setValue(int value)
void setVisible(bool visible)
void show()
void stop()
  • 1 个公有槽函数继承自 QObject

信号

void maximumChanged(int maximum)
void minimumChanged(int minimum)
void valueChanged(int value)
void visibilityChanged(bool visible)

其他继承的成员

  • 1 个公有变量继承自 QObject
  • 10 个静态公有成员继承自 QObject
  • 9 个受保护的函数继承自 QObject
  • 2 个受保护的变量继承自 QObject

详细描述

The QWinTaskbarProgress class represents a progress indicator in the Windows taskbar.

A progress indicator is used to give the user an indication of the progress of an operation and to reassure them that the application is still running.

The progress indicator uses the concept of steps. It is set up by specifying the minimum and maximum possible step values, and it will display the percentage of steps that have been completed when you later give it the current step value. The percentage is calculated by dividing the progress (value() - minimum()) divided by maximum() - minimum().

The minimum and maximum number of steps can be specified by calling setMinimum() and setMaximum(). The current number of steps is set with setValue(). The progress indicator can be rewound to the beginning with reset().

If minimum and maximum both are set to 0, the indicator shows up as a busy (indeterminate) indicator instead of a percentage of steps. This is useful when it is not possible to determine the number of steps.

Screenshot of a progress indicatorA progress indicator at 50%.
Screenshot of a paused progress indicatorA paused progress indicator at 50%.
Screenshot of a stopped progress indicatorA stopped progress indicator at 50%.
Screenshot of an indeterminate progress indicatorAn indeterminate progress indicator.

Note: The final appearance of the progress indicator varies depending on the active Windows theme.

参见 QWinTaskbarButton.

属性

maximum : int

This property holds the maximum value of the progress indicator

The default value is 100.

访问函数:

int maximum() const
void setMaximum(int maximum)

Notifier signal:

void maximumChanged(int maximum)

minimum : int

This property holds the minimum value of the progress indicator

The default value is 0.

访问函数:

int minimum() const
void setMinimum(int minimum)

Notifier signal:

void minimumChanged(int minimum)

paused : bool

This property holds whether the progress indicator is paused.

The default value is false.

The final appearance of a paused progress indicator depends on the active Windows theme. Typically, a paused progress indicator turns yellow to indicate that the progress is currently paused. Unlike a stopped progress indicator, a paused progress should not be used to indicate an error.

访问函数:

bool isPaused() const
void setPaused(bool paused)

参见 pause() and resume().

stopped : const bool

This property holds whether the progress indicator is stopped.

The default value is false.

The final appearance of a stopped progress indicator depends on the active Windows theme. Typically, a stopped progress indicator turns red to indicate that the progress is currently stopped. Unlike a paused progress indicator, a stopped progress may be used to indicate an error.

访问函数:

bool isStopped() const

参见 stop() and resume().

value : int

This property holds the current value of the progress indicator

The default value is 0.

访问函数:

int value() const
void setValue(int value)

Notifier signal:

void valueChanged(int value)

visible : bool

This property holds whether the progress indicator is visible.

The default value is false.

访问函数:

bool isVisible() const
void setVisible(bool visible)

Notifier signal:

void visibilityChanged(bool visible)

成员函数

QWinTaskbarProgress::QWinTaskbarProgress(QObject *parent = Q_NULLPTR)

Constructs a QWinTaskbarProgress with the parent object parent.

QWinTaskbarProgress::~QWinTaskbarProgress()

Destroys the QWinTaskbarProgress.

[slot] void QWinTaskbarProgress::hide()

Hides the progress indicator.

[slot] void QWinTaskbarProgress::pause()

Pauses the progress indicator.

参见 paused.

[slot] void QWinTaskbarProgress::reset()

Resets the progress indicator.

This function rewinds the value to the minimum value.

[slot] void QWinTaskbarProgress::resume()

Resumes a paused or stopped progress indicator.

参见 paused and stopped.

[slot] void QWinTaskbarProgress::setRange(int minimum, int maximum)

Sets both the minimum and maximum values.

[slot] void QWinTaskbarProgress::show()

Shows the progress indicator.

[slot] void QWinTaskbarProgress::stop()

Stops the progress indicator.

参见 stopped.