qt-material-widgets/components/progress_internal.h

42 lines
736 B
C
Raw Normal View History

2022-02-17 15:17:19 +00:00
#ifndef PROGRESS_INTERNAL_H
#define PROGRESS_INTERNAL_H
2017-09-29 13:33:26 +00:00
#include <QObject>
2022-02-17 15:17:19 +00:00
#include "progress.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
}
2022-02-17 15:17:19 +00:00
#endif // PROGRESS_INTERNAL_H