simplify Slider code

This commit is contained in:
laserpants 2016-03-27 17:12:57 +03:00
parent ac314b024d
commit 98308e72be
2 changed files with 2 additions and 4 deletions

View File

@ -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()

View File

@ -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