QProgressIndicator Class Reference

Detailed Description

The QProgressIndicator class lets an application display a progress indicator to show that a lengthy task is under way.

Progress indicators are indeterminate and do nothing more than spin to show that the application is busy.

See also
QProgressBar

Public Slots

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

Signals

void clicked ()
 
void rightClicked ()
 

Public Member Functions

 QProgressIndicator (QWidget *parent=0)
 
int animationDelay () const
 Returns the delay between animation steps. More...
 
bool isAnimated () const
 Returns a Boolean value indicating whether the component is currently animated. More...
 
bool isDisplayedWhenStopped () const
 Returns a Boolean value indicating whether the receiver shows itself even when it is not animating. More...
 
const QColor & color () const
 Returns the color of the component. More...
 
QSize sizeHint () const override
 
void setWidth (int width)
 
int heightForWidth (int w) const override
 

Protected Member Functions

void enterEvent (QEnterEvent *event) override
 
void leaveEvent (QEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void timerEvent (QTimerEvent *event) override
 
void paintEvent (QPaintEvent *event) override
 

Properties

int delay
 
bool displayedWhenStopped
 
QColor color
 

Constructor & Destructor Documentation

◆ QProgressIndicator()

QProgressIndicator::QProgressIndicator ( QWidget *  parent = 0)

Member Function Documentation

◆ animationDelay()

int QProgressIndicator::animationDelay ( ) const
inline

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

◆ clicked

void QProgressIndicator::clicked ( )
signal

◆ color()

const QColor & QProgressIndicator::color ( ) const
inline

Returns the color of the component.

See also
setColor

◆ enterEvent()

void QProgressIndicator::enterEvent ( QEnterEvent *  event)
overrideprotected

◆ heightForWidth()

int QProgressIndicator::heightForWidth ( int  w) const
override

◆ isAnimated()

bool QProgressIndicator::isAnimated ( ) const

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

Returns
Animation state.
See also
startAnimation stopAnimation

◆ isDisplayedWhenStopped()

bool QProgressIndicator::isDisplayedWhenStopped ( ) const

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

◆ leaveEvent()

void QProgressIndicator::leaveEvent ( QEvent *  event)
overrideprotected

◆ mouseReleaseEvent()

void QProgressIndicator::mouseReleaseEvent ( QMouseEvent *  event)
inlineoverrideprotected

◆ paintEvent()

void QProgressIndicator::paintEvent ( QPaintEvent *  event)
overrideprotected

◆ rightClicked

void QProgressIndicator::rightClicked ( )
signal

◆ 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

◆ setColor

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

Sets the color of the components to the given color.

See also
color

◆ setDisplayedWhenStopped

void QProgressIndicator::setDisplayedWhenStopped ( bool  state,
const QString &  staticDisplay = "" 
)
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

◆ setToolTips

void QProgressIndicator::setToolTips ( const QString &  staticToolTip,
const QString &  animatedToolTip 
)
slot

◆ setWidth()

void QProgressIndicator::setWidth ( int  width)
inline

◆ sizeHint()

QSize QProgressIndicator::sizeHint ( ) const
inlineoverride

◆ startAnimation

void QProgressIndicator::startAnimation ( )
slot

Starts the spin animation.

See also
stopAnimation isAnimated

◆ stopAnimation

void QProgressIndicator::stopAnimation ( )
slot

Stops the spin animation.

See also
startAnimation isAnimated

◆ timerEvent()

void QProgressIndicator::timerEvent ( QTimerEvent *  event)
overrideprotected

Property Documentation

◆ color

QColor QProgressIndicator::color
readwrite

◆ delay

int QProgressIndicator::delay
readwrite

◆ displayedWhenStopped

bool QProgressIndicator::displayedWhenStopped
readwrite

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