QtPass 1.6.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
QProgressIndicator Class Reference

QProgressIndicator provides a simple indeterminate progress indicator widget that spins to show the application is busy. More...

#include <qprogressindicator.h>

Inheritance diagram for QProgressIndicator:
Collaboration diagram for QProgressIndicator:

Public Slots

void startAnimation ()
 Starts the spin animation.
void stopAnimation ()
 Stops the spin animation.
void setAnimationDelay (int delay)
 Sets the delay between animation steps.
void setDisplayedWhenStopped (bool state)
 Sets whether the component hides itself when it is not animating.
void setColor (const QColor &color)
 Sets the color of the components to the given color.

Public Member Functions

 QProgressIndicator (QWidget *parent=nullptr)
 QProgressIndicator::QProgressIndicator constructor.
auto animationDelay () const -> int
 Returns the delay between animation steps.
auto isAnimated () const -> bool
 Returns a Boolean value indicating whether the component is currently animated.
auto isDisplayedWhenStopped () const -> bool
 Returns a Boolean value indicating whether the receiver shows itself even when it is not animating.
auto color () const -> const QColor &
 Returns the color of the component.
virtual auto sizeHint () const -> QSize
 QProgressIndicator::sizeHint default minimum size.
auto heightForWidth (int w) const -> int
 QProgressIndicator::heightForWidth square ratio.

Protected Member Functions

virtual void timerEvent (QTimerEvent *event)
 QProgressIndicator::timerEvent do the actual animation.
virtual void paintEvent (QPaintEvent *event)
 QProgressIndicator::paintEvent draw the spinner.

Detailed Description

QProgressIndicator provides a simple indeterminate progress indicator widget that spins to show the application is busy.

See also
QProgressBar

Returns the delay between animation steps.

Returns
The number of milliseconds between animation steps. The default value is 40.
See also
setAnimationDelay

Indicates whether the indicator is currently animating.

Returns
true if the indicator is animating, false otherwise.
See also
startAnimation stopAnimation

Indicates whether the indicator remains visible when not animating.

Returns
true if the indicator shows itself when stopped, false otherwise. The default is false.
See also
setDisplayedWhenStopped

Returns the current drawing color used by the indicator.

Returns
Reference to the indicator's QColor.
See also
setColor

Starts the spin animation.

See also
stopAnimation isAnimated

Stops the spin animation.

See also
startAnimation isAnimated

Sets the delay between animation steps.

Parameters
delayDelay in milliseconds. Values larger than 40 slow the animation; values smaller than 40 speed it up.
See also
animationDelay

Sets whether the indicator remains visible when not animating.

Parameters
stateSet to true to keep the indicator visible when stopped; set to false to hide it when stopped.
See also
isDisplayedWhenStopped

Sets the drawing color for the indicator.

Parameters
colorThe new color to use for rendering the indicator.
See also
color

Definition at line 107 of file qprogressindicator.h.

Constructor & Destructor Documentation

◆ QProgressIndicator()

QProgressIndicator::QProgressIndicator ( QWidget * parent = nullptr)
explicit

QProgressIndicator::QProgressIndicator constructor.

Parameters
parentwidget the indicator is placed in.

Definition at line 36 of file qprogressindicator.cpp.

Member Function Documentation

◆ animationDelay()

auto QProgressIndicator::animationDelay ( ) const -> int
inlinenodiscard

Returns the delay between animation steps.

Returns
The number of milliseconds between animation steps. By default, the animation delay is set to 40 milliseconds.
See also
setAnimationDelay

Definition at line 118 of file qprogressindicator.h.

◆ color()

auto QProgressIndicator::color ( ) const -> const QColor &
inlinenodiscard

Returns the color of the component.

See also
setColor

Definition at line 138 of file qprogressindicator.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ heightForWidth()

auto QProgressIndicator::heightForWidth ( int w) const -> int
nodiscard

QProgressIndicator::heightForWidth square ratio.

Parameters
wrequested width
Returns
w returned height

Definition at line 102 of file qprogressindicator.cpp.

◆ isAnimated()

auto QProgressIndicator::isAnimated ( ) const -> bool
nodiscard

Returns a Boolean value indicating whether the component is currently animated.

Returns
Animation state.
See also
startAnimation stopAnimation

Definition at line 43 of file qprogressindicator.cpp.

Here is the caller graph for this function:

◆ isDisplayedWhenStopped()

auto QProgressIndicator::isDisplayedWhenStopped ( ) const -> bool
nodiscard

Returns a Boolean value indicating whether the receiver shows itself even when it is not animating.

Returns
Return true if the progress indicator shows itself even when it is not animating. By default, it returns false.
See also
setDisplayedWhenStopped

Definition at line 51 of file qprogressindicator.cpp.

◆ paintEvent()

void QProgressIndicator::paintEvent ( QPaintEvent * event)
protectedvirtual

QProgressIndicator::paintEvent draw the spinner.

Definition at line 116 of file qprogressindicator.cpp.

Here is the call graph for this function:

◆ setAnimationDelay

void QProgressIndicator::setAnimationDelay ( int delay)
slot

Sets the delay between animation steps.

Setting the delay to a value larger than 40 slows the animation, while setting the delay to a smaller value speeds it up.

Parameters
delayThe delay, in milliseconds.
See also
animationDelay

Definition at line 73 of file qprogressindicator.cpp.

◆ setColor

void QProgressIndicator::setColor ( const QColor & color)
slot

Sets the color of the components to the given color.

See also
color

Definition at line 85 of file qprogressindicator.cpp.

Here is the call graph for this function:

◆ setDisplayedWhenStopped

void QProgressIndicator::setDisplayedWhenStopped ( bool state)
slot

Sets whether the component hides itself when it is not animating.

Parameters
stateThe animation state. Set false to hide the progress indicator when it is not animating; otherwise true.
See also
isDisplayedWhenStopped

Definition at line 45 of file qprogressindicator.cpp.

◆ sizeHint()

auto QProgressIndicator::sizeHint ( ) const -> QSize
nodiscardvirtual

QProgressIndicator::sizeHint default minimum size.

Returns
QSize(20, 20)

Definition at line 95 of file qprogressindicator.cpp.

◆ startAnimation

void QProgressIndicator::startAnimation ( )
slot

Starts the spin animation.

See also
stopAnimation isAnimated

Definition at line 55 of file qprogressindicator.cpp.

◆ stopAnimation

void QProgressIndicator::stopAnimation ( )
slot

Stops the spin animation.

See also
startAnimation isAnimated

Definition at line 63 of file qprogressindicator.cpp.

◆ timerEvent()

void QProgressIndicator::timerEvent ( QTimerEvent * event)
protectedvirtual

QProgressIndicator::timerEvent do the actual animation.

Definition at line 107 of file qprogressindicator.cpp.


The documentation for this class was generated from the following files: