IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QWinTaskbarProgress Class

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

This class was introduced in Qt 5.2.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QWinTaskbarProgress Class

  • Header: QWinTaskbarProgress

  • Since: Qt 5.2

  • qmake: QT += winextras

  • Inherits: QObject

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.

Image non disponible Screenshot of a progress indicator

A progress indicator at 50%.

Image non disponible Screenshot of a paused progress indicator

A paused progress indicator at 50%.

Image non disponible Screenshot of a stopped progress indicator

A stopped progress indicator at 50%.

Image non disponible Screenshot of an indeterminate progress indicator

An indeterminate progress indicator.

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

See Also

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

See also pause(), resume()

[read-only] 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

See also stop(), 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

 

[explicit] QWinTaskbarProgress::QWinTaskbarProgress(QObject *parent = nullptr)

Constructs a QWinTaskbarProgress with the parent object parent.

[virtual] QWinTaskbarProgress::~QWinTaskbarProgress()

Destroys the QWinTaskbarProgress.

void QWinTaskbarProgress::hide()

Hides the progress indicator.

void QWinTaskbarProgress::pause()

Pauses the progress indicator.

See Also

See also paused

void QWinTaskbarProgress::reset()

Resets the progress indicator.

This function rewinds the value to the minimum value.

void QWinTaskbarProgress::resume()

Resumes a paused or stopped progress indicator.

See Also

See also paused, stopped

void QWinTaskbarProgress::setRange(int minimum, int maximum)

Sets both the minimum and maximum values.

void QWinTaskbarProgress::show()

Shows the progress indicator.

void QWinTaskbarProgress::stop()

Stops the progress indicator.

See Also

See also stopped

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+