qt-material-widgets/components/qtmaterialprogress_internal.h

41 lines
775 B
C
Raw Normal View History

2017-09-29 13:33:26 +00:00
#ifndef QTMATERIALPROGRESS_INTERNAL_H
#define QTMATERIALPROGRESS_INTERNAL_H
#include <QObject>
#include "qtmaterialprogress.h"
2022-02-17 02:33:48 +00:00
namespace md
{
2017-09-29 13:33:26 +00:00
2022-02-17 02:33:48 +00:00
class ProgressBarDelegate : public QObject
2017-09-29 13:33:26 +00:00
{
Q_OBJECT
Q_PROPERTY(qreal offset WRITE setOffset READ offset)
public:
2022-02-17 02:33:48 +00:00
ProgressBarDelegate(ProgressBar *parent);
~ProgressBarDelegate();
2017-09-29 13:33:26 +00:00
inline void setOffset(qreal offset);
inline qreal offset() const;
private:
2022-02-17 02:33:48 +00:00
Q_DISABLE_COPY(ProgressBarDelegate)
2017-09-29 13:33:26 +00:00
2022-02-17 02:33:48 +00:00
ProgressBar *const m_progress;
2017-09-29 13:33:26 +00:00
qreal m_offset;
};
2022-02-17 02:33:48 +00:00
inline void ProgressBarDelegate::setOffset(qreal offset)
2017-09-29 13:33:26 +00:00
{
m_offset = offset;
m_progress->update();
}
2022-02-17 02:33:48 +00:00
inline qreal ProgressBarDelegate::offset() const
2017-09-29 13:33:26 +00:00
{
return m_offset;
}
2022-02-17 02:33:48 +00:00
}
2017-09-29 13:33:26 +00:00
#endif // QTMATERIALPROGRESS_INTERNAL_H