From 98308e72be59d11337322d87acc70f7fee8d1d4f Mon Sep 17 00:00:00 2001 From: laserpants Date: Sun, 27 Mar 2016 17:12:57 +0300 Subject: [PATCH] simplify Slider code --- components/toggle.cpp | 2 -- components/toggle.h | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/components/toggle.cpp b/components/toggle.cpp index b88c42a..c24a109 100644 --- a/components/toggle.cpp +++ b/components/toggle.cpp @@ -20,8 +20,6 @@ Thumb::Thumb(Toggle *parent) _animation->setDuration(350); _animation->setStartValue(0); _animation->setEndValue(1); - - connect(_animation, SIGNAL(valueChanged(QVariant)), this, SLOT(update())); } Thumb::~Thumb() diff --git a/components/toggle.h b/components/toggle.h index 68e1f55..b0507f0 100644 --- a/components/toggle.h +++ b/components/toggle.h @@ -17,7 +17,7 @@ public: explicit Thumb(Toggle *parent); ~Thumb(); - inline void setProgress(qreal p) { _progress = p; } + inline void setProgress(qreal p) { _progress = p; update(); } inline qreal progress() const { return _progress; } signals: @@ -31,7 +31,7 @@ protected: private: Toggle *const _toggle; QPropertyAnimation *const _animation; - qreal _progress; + qreal _progress; }; class Toggle : public QAbstractButton