6 #include <QAbstractButton> 10 class QPropertyAnimation;
16 Q_PROPERTY(
int offset READ offset WRITE setOffset)
17 Q_PROPERTY(QBrush brush READ brush WRITE setBrush)
22 QSize sizeHint()
const override;
24 void setBrush(
const QBrush& brsh) {
28 NODISCARD
auto brush()
const noexcept {
32 NODISCARD
auto offset()
const noexcept {
36 void setOffset(
const int o);
39 void toggled(
const bool checked);
42 void paintEvent(QPaintEvent* e)
override;
43 void mouseReleaseEvent(QMouseEvent* e)
override;
44 void enterEvent(QEvent* e)
override;
49 int m_x, m_y, m_width{50}, m_height{16}, m_margin{3};
50 QBrush m_thumb{
"#d5d5d5"}, m_track, m_brush;
51 QPropertyAnimation* m_anim{
nullptr};