QWinTaskbarProgress Class

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

Header: #include <QWinTaskbarProgress>
qmake: QT += winextras
Since: Qt 5.2
Inherits: QObject

This class is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This class was introduced in Qt 5.2.

Properties

Public Functions

QWinTaskbarProgress(QObject *parent = nullptr)
virtual ~QWinTaskbarProgress()
bool isPaused() const
bool isStopped() const
bool isVisible() const
int maximum() const
int minimum() const
int value() const

Public Slots

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()

Signals

void maximumChanged(int maximum)
void minimumChanged(int minimum)
void pausedChanged(bool paused)
void stoppedChanged(bool stopped)
void valueChanged(int value)
void visibilityChanged(bool visible)

Detailed Description

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.

See also QWinTaskbarButton.

Property Documentation

maximum : int

This property holds the maximum value of the progress indicator

The default value is 100.

Access functions:

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.

Access functions:

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.

Access functions:

bool isPaused() const
void setPaused(bool paused)

Notifier signal:

void pausedChanged(bool paused)

See also 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.

Access functions:

bool isStopped() const

Notifier signal:

void stoppedChanged(bool stopped)

See also stop() and resume().

value : int

This property holds the current value of the progress indicator

The default value is 0.

Access functions:

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.

Access functions:

bool isVisible() const
void setVisible(bool visible)

Notifier signal:

void visibilityChanged(bool visible)

Member Function Documentation

QWinTaskbarProgress::QWinTaskbarProgress(QObject *parent = nullptr)

Constructs a QWinTaskbarProgress with the parent object parent.

[slot] void QWinTaskbarProgress::hide()

Hides the progress indicator.

[slot] void QWinTaskbarProgress::pause()

Pauses the progress indicator.

See also 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.

See also 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.

See also stopped.

[virtual] QWinTaskbarProgress::~QWinTaskbarProgress()

Destroys the QWinTaskbarProgress.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.