scrollbar animation effect
Unsolved
General and Desktop
-
I want to give an animation effect that makes the qScrollbar appear whenever I move it and hide it when it stops moving, how can I do that?
There is a user class that inherits Scrollbar, and we want to animate it by receiving the valuechanged signal.void usrScrollBar::VisibleSlider(bool bShow) { if (bShow) { auto anim = new QPropertyAnimation(this, "AnmFrameAlpha", this); anim->setDuration(2000); anim->setStartValue(0.00); anim->setEndValue(1.00); anim->start(QAbstractAnimation::DeleteWhenStopped); } else { auto anim = new QPropertyAnimation(this, "windowOpacity"); anim->setDuration(2000); anim->setStartValue(1.00); anim->setEndValue(0.00); anim->start(QAbstractAnimation::DeleteWhenStopped); emit UserDefineFinishScroll(); } this->setVisible(bShow); } qreal usrScrollBar::AnmFrameAlpha() const { qDebug() << QString("AnmFrameAlpha : %1").arg(this->windowOpacity()); return this->windowOpacity(); } void usrScrollBar::SetAnmFrameAlpha(qreal rAlpha) { this->setWindowOpacity(rAlpha); this->update(); }