qt-material-widgets/components/qtmaterialcircularprogress_...

75 lines
1.6 KiB
C
Raw Normal View History

2017-09-29 09:14:01 +00:00
#ifndef QTMATERIALCIRCULARPROGRESS_INTERNAL_H
#define QTMATERIALCIRCULARPROGRESS_INTERNAL_H
#include <QObject>
#include "qtmaterialcircularprogress.h"
2022-02-17 01:06:18 +00:00
namespace md
{
2017-09-29 09:14:01 +00:00
2022-02-17 01:06:18 +00:00
class CircularProgressDelegate : public QObject
2017-09-29 09:14:01 +00:00
{
Q_OBJECT
Q_PROPERTY(qreal dashOffset WRITE setDashOffset READ dashOffset)
Q_PROPERTY(qreal dashLength WRITE setDashLength READ dashLength)
Q_PROPERTY(int angle WRITE setAngle READ angle)
public:
2022-02-17 01:06:18 +00:00
CircularProgressDelegate(CircularProgress *parent);
~CircularProgressDelegate();
2017-09-29 09:14:01 +00:00
inline void setDashOffset(qreal offset);
inline qreal dashOffset() const;
inline void setDashLength(qreal length);
inline qreal dashLength() const;
inline void setAngle(int angle);
inline int angle() const;
private:
2022-02-17 01:06:18 +00:00
Q_DISABLE_COPY(CircularProgressDelegate)
2017-09-29 09:14:01 +00:00
2022-02-17 01:06:18 +00:00
CircularProgress *const m_progress;
2017-09-29 09:14:01 +00:00
qreal m_dashOffset;
qreal m_dashLength;
int m_angle;
};
2022-02-17 01:06:18 +00:00
inline void CircularProgressDelegate::setDashOffset(qreal offset)
2017-09-29 09:14:01 +00:00
{
m_dashOffset = offset;
m_progress->update();
}
2022-02-17 01:06:18 +00:00
inline qreal CircularProgressDelegate::dashOffset() const
2017-09-29 09:14:01 +00:00
{
return m_dashOffset;
}
2022-02-17 01:06:18 +00:00
inline void CircularProgressDelegate::setDashLength(qreal length)
2017-09-29 09:14:01 +00:00
{
m_dashLength = length;
m_progress->update();
}
2022-02-17 01:06:18 +00:00
inline qreal CircularProgressDelegate::dashLength() const
2017-09-29 09:14:01 +00:00
{
return m_dashLength;
}
2022-02-17 01:06:18 +00:00
inline void CircularProgressDelegate::setAngle(int angle)
2017-09-29 09:14:01 +00:00
{
m_angle = angle;
m_progress->update();
}
2022-02-17 01:06:18 +00:00
inline int CircularProgressDelegate::angle() const
2017-09-29 09:14:01 +00:00
{
return m_angle;
}
2022-02-17 01:06:18 +00:00
}
2017-09-29 09:14:01 +00:00
#endif // QTMATERIALCIRCULARPROGRESS_INTERNAL_H