cutter/src/common/ProgressIndicator.h

37 lines
840 B
C
Raw Normal View History

2018-06-24 19:12:02 +00:00
#ifndef PROGRESSINDICATOR_H
#define PROGRESSINDICATOR_H
#include <QWidget>
2021-01-24 14:50:13 +00:00
class ProgressIndicator : public QWidget
2018-06-24 19:12:02 +00:00
{
public:
ProgressIndicator(QWidget *parent = nullptr);
virtual ~ProgressIndicator();
QSize minimumSizeHint() const override;
QSize sizeHint() const override;
2021-01-24 14:50:13 +00:00
bool getProgressIndicatorVisible() const { return progressIndicatorVisible; }
2018-06-24 19:12:02 +00:00
void setProgressIndicatorVisible(bool visible);
2021-01-24 14:50:13 +00:00
bool getAnimating() const { return animating; }
2018-06-24 19:12:02 +00:00
void setAnimating(bool animating);
protected:
void timerEvent(QTimerEvent *event) override;
void paintEvent(QPaintEvent *event) override;
private:
bool animating = true;
bool progressIndicatorVisible = true;
int animationTimerId = 0;
int animationState = 0;
void updateAnimationTimer();
};
2021-01-24 14:50:13 +00:00
#endif // PROGRESSINDICATOR_H