37 lines
693 B
C++
37 lines
693 B
C++
#ifndef QMODERNPROGRESSBAR_H
|
|
#define QMODERNPROGRESSBAR_H
|
|
|
|
#include <QProgressBar>
|
|
#include <QObject>
|
|
#include <QPainter>
|
|
#include <QPaintEvent>
|
|
#include <QDebug>
|
|
#include <QTimer>
|
|
#include <QPropertyAnimation>
|
|
|
|
class QModernProgressBar : public QProgressBar
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
QModernProgressBar(QWidget* parent = nullptr);
|
|
|
|
void setIndeterminate(bool indeterminate);
|
|
bool getIndeterminate();
|
|
|
|
protected:
|
|
QTimer* refreshTimer;
|
|
QPropertyAnimation* indeterminateAnimtion;
|
|
|
|
void paintEvent(QPaintEvent *e) override;
|
|
|
|
private:
|
|
bool indeterminate;
|
|
int preIndeterminateValue;
|
|
|
|
protected slots:
|
|
void updateIndeterminate();
|
|
|
|
};
|
|
|
|
#endif // QMODERNPROGRESSBAR_H
|