This repository has been archived on 2022-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
modern-linbo-gui/headers/qmodernprogressbar.h
2020-11-19 14:39:32 +01:00

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