qtmaterialprogress_internal.h 815 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef QTMATERIALPROGRESS_INTERNAL_H
  2. #define QTMATERIALPROGRESS_INTERNAL_H
  3. #include <QObject>
  4. #include "qtmaterialprogress.h"
  5. class QtMaterialProgressDelegate : public QObject
  6. {
  7. Q_OBJECT
  8. Q_PROPERTY(qreal offset WRITE setOffset READ offset)
  9. public:
  10. QtMaterialProgressDelegate(QtMaterialProgress *parent);
  11. ~QtMaterialProgressDelegate();
  12. inline void setOffset(qreal offset);
  13. inline qreal offset() const;
  14. private:
  15. Q_DISABLE_COPY(QtMaterialProgressDelegate)
  16. QtMaterialProgress *const m_progress;
  17. qreal m_offset;
  18. };
  19. inline void QtMaterialProgressDelegate::setOffset(qreal offset)
  20. {
  21. m_offset = offset;
  22. m_progress->update();
  23. }
  24. inline qreal QtMaterialProgressDelegate::offset() const
  25. {
  26. return m_offset;
  27. }
  28. #endif // QTMATERIALPROGRESS_INTERNAL_H