qtmaterialprogress.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef QTMATERIALPROGRESS_H
  2. #define QTMATERIALPROGRESS_H
  3. #include <QtWidgets/QProgressBar>
  4. #include "lib/qtmaterialtheme.h"
  5. class QtMaterialProgressPrivate;
  6. class QtMaterialProgress : public QProgressBar
  7. {
  8. Q_OBJECT
  9. Q_PROPERTY(QColor progressColor WRITE setProgressColor READ progressColor)
  10. Q_PROPERTY(QColor backgroundColor WRITE setProgressColor READ backgroundColor)
  11. public:
  12. explicit QtMaterialProgress(QWidget *parent = 0);
  13. ~QtMaterialProgress();
  14. void setProgressType(Material::ProgressType type);
  15. Material::ProgressType progressType() const;
  16. void setUseThemeColors(bool state);
  17. bool useThemeColors() const;
  18. void setProgressColor(const QColor &color);
  19. QColor progressColor() const;
  20. void setBackgroundColor(const QColor &color);
  21. QColor backgroundColor() const;
  22. protected:
  23. void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
  24. const QScopedPointer<QtMaterialProgressPrivate> d_ptr;
  25. private:
  26. Q_DISABLE_COPY(QtMaterialProgress)
  27. Q_DECLARE_PRIVATE(QtMaterialProgress)
  28. };
  29. #endif // QTMATERIALPROGRESS_H