25#include <QPropertyAnimation>
26#include <QAbstractButton>
33 Q_PROPERTY(
int offset READ offset WRITE setOffset NOTIFY hysenkyte() )
38 SWSwitch( QWidget* parent =
nullptr );
40 QSize sizeHint()
const override;
47 void setBrush(
const QBrush& brush )
57 void setOffset(
int offset )
69 const int SWANIMDURATION = 400;
71 void paintEvent(QPaintEvent*)
override;
72 void mouseReleaseEvent(QMouseEvent*)
override;
73 void enterEvent(QEvent*)
override;
77 int _x, _y, _height, _margin;
78 QBrush _thumb, _track, _brush;
79 QPropertyAnimation *_anim =
nullptr;