7 #ifndef SWIFT_GUI_LOADINDICATOR_H
8 #define SWIFT_GUI_LOADINDICATOR_H
36 CLoadIndicator(
int width = 64,
int height = 64, QWidget *parent =
nullptr);
46 bool isAnimated()
const;
51 bool isDisplayedWhenStopped()
const;
55 const QColor &
color()
const {
return m_color; }
58 virtual QSize sizeHint()
const override;
61 virtual int heightForWidth(
int w)
const override;
64 void paint(QPainter &painter)
const;
67 void centerLoadIndicator(
const QPoint &middle);
76 int startAnimation(std::chrono::milliseconds timeout = std::chrono::milliseconds(0),
77 bool processEvents =
false);
81 void stopAnimation(
int indicatorId = -1);
86 void setAnimationDelay(
int delay);
91 void setDisplayedWhenStopped(
bool state);
95 void setColor(
const QColor &color);
99 virtual void timerEvent(QTimerEvent *event)
override;
102 virtual void paintEvent(QPaintEvent *event)
override;
105 bool isParentVisible()
const;
110 int m_delayMs = 1000;
112 QList<int> m_pendingIds;
113 bool m_displayedWhenStopped =
false;
114 QColor m_color = Qt::blue;
136 bool isShowingLoadIndicator()
const;
139 void showLoading(std::chrono::milliseconds timeout = std::chrono::milliseconds(0),
bool processEvents =
true);
145 bool isLoadInProgress()
const;
149 void centerLoadIndicator();
153 virtual void indicatorTimedOut();
155 QWidget *m_usingWidget =
nullptr;
157 bool m_loadInProgress =
false;
158 int m_indicatorId = -1;
Enable widget class for load indicator.
CLoadIndicatorEnabled & operator=(const CLoadIndicatorEnabled &)=delete
Copy assignment operator.
CLoadIndicatorEnabled(const CLoadIndicatorEnabled &)=delete
Copy constructor.
virtual ~CLoadIndicatorEnabled()
Destructor.
The QProgressIndicator class lets an application display a progress indicator to show that a lengthy ...
const QColor & color() const
Returns the color of the component.
int getAnimationDelayTimeMs() const
Returns the delay between animation steps.
void timedOut()
Timed out.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.