swift
Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
swift::gui::CLoadIndicator Class Reference

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

Inheritance diagram for swift::gui::CLoadIndicator:
[legend]

Public Slots

int startAnimation (std::chrono::milliseconds timeout=std::chrono::milliseconds(0), bool processEvents=false)
 Starts the spin animation. More...
 
void stopAnimation (int indicatorId=-1)
 Stops the spin animation. More...
 
void setAnimationDelay (int delay)
 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. More...
 
void setDisplayedWhenStopped (bool state)
 Sets whether the component hides itself when it is not animating. More...
 
void setColor (const QColor &color)
 Sets the color of the components to the given color. More...
 

Signals

void timedOut ()
 Timed out.
 

Public Member Functions

 CLoadIndicator (int width=64, int height=64, QWidget *parent=nullptr)
 Constructor.
 
int getAnimationDelayTimeMs () 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...
 
virtual QSize sizeHint () const
 
virtual int heightForWidth (int w) const
 
void paint (QPainter &painter) const
 Paint to another painter.
 
void centerLoadIndicator (const QPoint &middle)
 Center this load indicator.
 

Protected Member Functions

virtual void timerEvent (QTimerEvent *event)
 
virtual void paintEvent (QPaintEvent *event)
 
bool isParentVisible () const
 Is parent widget visible?
 

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.

Note
based on https://github.com/mojocorp/QProgressIndicator under MIT license

Definition at line 30 of file loadindicator.h.

Member Function Documentation

◆ color()

const QColor& swift::gui::CLoadIndicator::color ( ) const
inline

Returns the color of the component.

See also
setColor

Definition at line 55 of file loadindicator.h.

◆ getAnimationDelayTimeMs()

int swift::gui::CLoadIndicator::getAnimationDelayTimeMs ( ) 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

Definition at line 41 of file loadindicator.h.

◆ heightForWidth()

int swift::gui::CLoadIndicator::heightForWidth ( int  w) const
virtual

Definition at line 114 of file loadindicator.cpp.

◆ isAnimated()

bool swift::gui::CLoadIndicator::isAnimated ( ) const

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

Returns
Animation state.
See also
startAnimation stopAnimation

Definition at line 32 of file loadindicator.cpp.

◆ isDisplayedWhenStopped()

bool swift::gui::CLoadIndicator::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

Definition at line 40 of file loadindicator.cpp.

◆ paintEvent()

void swift::gui::CLoadIndicator::paintEvent ( QPaintEvent *  event)
protectedvirtual

Definition at line 123 of file loadindicator.cpp.

◆ setAnimationDelay

void swift::gui::CLoadIndicator::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 95 of file loadindicator.cpp.

◆ setColor

void swift::gui::CLoadIndicator::setColor ( const QColor &  color)
slot

Sets the color of the components to the given color.

See also
color

Definition at line 106 of file loadindicator.cpp.

◆ setDisplayedWhenStopped

void swift::gui::CLoadIndicator::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 34 of file loadindicator.cpp.

◆ sizeHint()

QSize swift::gui::CLoadIndicator::sizeHint ( ) const
virtual

Definition at line 112 of file loadindicator.cpp.

◆ startAnimation

int swift::gui::CLoadIndicator::startAnimation ( std::chrono::milliseconds  timeout = std::chrono::milliseconds(0),
bool  processEvents = false 
)
slot

Starts the spin animation.

See also
stopAnimation isAnimated

Definition at line 42 of file loadindicator.cpp.

◆ stopAnimation

void swift::gui::CLoadIndicator::stopAnimation ( int  indicatorId = -1)
slot

Stops the spin animation.

See also
startAnimation isAnimated

Definition at line 75 of file loadindicator.cpp.

◆ timerEvent()

void swift::gui::CLoadIndicator::timerEvent ( QTimerEvent *  event)
protectedvirtual

Definition at line 116 of file loadindicator.cpp.


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