qt-material-widgets/components/toggle_internal.h

34 lines
587 B
C
Raw Normal View History

2016-05-29 10:08:55 +00:00
#ifndef TOGGLE_INTERNAL_H
#define TOGGLE_INTERNAL_H
#include <QWidget>
class Toggle;
class Thumb : public QWidget
{
Q_OBJECT
2016-05-29 11:58:20 +00:00
Q_PROPERTY(qreal shift WRITE setShift READ shift)
2016-05-29 10:08:55 +00:00
public:
Thumb(Toggle *parent);
~Thumb();
2016-05-29 11:58:20 +00:00
void setShift(qreal shift);
inline qreal shift() const { return _shift; }
protected:
bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
2016-05-29 10:08:55 +00:00
private:
Q_DISABLE_COPY(Thumb)
2016-05-29 11:58:20 +00:00
Toggle *const _toggle;
qreal _shift;
int _offset;
2016-05-29 10:08:55 +00:00
};
#endif // TOGGLE_INTERNAL_H