2017-09-29 09:14:01 +00:00
|
|
|
#ifndef QTMATERIALCIRCULARPROGRESS_H
|
|
|
|
#define QTMATERIALCIRCULARPROGRESS_H
|
|
|
|
|
|
|
|
#include <QtWidgets/QProgressBar>
|
|
|
|
#include "lib/qtmaterialtheme.h"
|
|
|
|
|
2022-02-17 01:06:18 +00:00
|
|
|
namespace md
|
|
|
|
{
|
|
|
|
|
|
|
|
class CircularProgressPrivate;
|
2017-09-29 09:14:01 +00:00
|
|
|
|
2022-02-17 01:06:18 +00:00
|
|
|
class CircularProgress : public QProgressBar
|
2017-09-29 09:14:01 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
Q_PROPERTY(qreal lineWidth WRITE setLineWidth READ lineWidth)
|
|
|
|
Q_PROPERTY(qreal size WRITE setSize READ size)
|
|
|
|
Q_PROPERTY(QColor color WRITE setColor READ color)
|
|
|
|
|
|
|
|
public:
|
2022-02-17 01:06:18 +00:00
|
|
|
explicit CircularProgress(QWidget *parent = 0);
|
|
|
|
~CircularProgress();
|
2017-09-29 09:14:01 +00:00
|
|
|
|
|
|
|
void setProgressType(Material::ProgressType type);
|
|
|
|
Material::ProgressType progressType() const;
|
|
|
|
|
|
|
|
void setUseThemeColors(bool value);
|
|
|
|
bool useThemeColors() const;
|
|
|
|
|
|
|
|
void setLineWidth(qreal width);
|
|
|
|
qreal lineWidth() const;
|
|
|
|
|
|
|
|
void setSize(int size);
|
|
|
|
int size() const;
|
|
|
|
|
|
|
|
void setColor(const QColor &color);
|
|
|
|
QColor color() const;
|
|
|
|
|
|
|
|
QSize sizeHint() const Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
|
2022-02-17 01:06:18 +00:00
|
|
|
const QScopedPointer<CircularProgressPrivate> d_ptr;
|
2017-09-29 09:14:01 +00:00
|
|
|
|
|
|
|
private:
|
2022-02-17 01:06:18 +00:00
|
|
|
Q_DISABLE_COPY(CircularProgress)
|
|
|
|
Q_DECLARE_PRIVATE(CircularProgress)
|
2017-09-29 09:14:01 +00:00
|
|
|
};
|
|
|
|
|
2022-02-17 01:06:18 +00:00
|
|
|
}
|
|
|
|
|
2017-09-29 09:14:01 +00:00
|
|
|
#endif // QTMATERIALCIRCULARPROGRESS_H
|