diff options
Diffstat (limited to 'src/widgets/styles/qcleanlooksstyle.cpp')
-rw-r--r-- | src/widgets/styles/qcleanlooksstyle.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/widgets/styles/qcleanlooksstyle.cpp b/src/widgets/styles/qcleanlooksstyle.cpp index 896f2ead32..5b8b5e0b9f 100644 --- a/src/widgets/styles/qcleanlooksstyle.cpp +++ b/src/widgets/styles/qcleanlooksstyle.cpp @@ -1751,20 +1751,21 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o reverse = !reverse; QRect progressBar; + Q_D(const QCleanlooksStyle); if (!indeterminate) { if (!reverse) { progressBar.setRect(rect.left() + 1, rect.top() + 1, width + 1, rect.height() - 3); } else { progressBar.setRect(rect.right() - 1 - width, rect.top() + 1, width + 1, rect.height() - 3); } + d->stopAnimation(option->styleObject); } else { - Q_D(const QCleanlooksStyle); int slideWidth = ((rect.width() - 4) * 2) / 3; int step = 0; -#ifndef QT_NO_ANIMATION - if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(widget))) + if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(option->styleObject))) step = animation->progressStep(slideWidth); -#endif + else + d->startAnimation(new QProgressStyleAnimation(d->animationFps, option->styleObject)); progressBar.setRect(rect.left() + 1 + step, rect.top() + 1, slideWidth / 2, rect.height() - 3); } |