simplify Slider code
This commit is contained in:
parent
ac314b024d
commit
98308e72be
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue