diff options
Diffstat (limited to 'src/widgets/styles/qcleanlooksstyle.cpp')
-rw-r--r-- | src/widgets/styles/qcleanlooksstyle.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/widgets/styles/qcleanlooksstyle.cpp b/src/widgets/styles/qcleanlooksstyle.cpp index 99e4b179f4..896f2ead32 100644 --- a/src/widgets/styles/qcleanlooksstyle.cpp +++ b/src/widgets/styles/qcleanlooksstyle.cpp @@ -67,6 +67,7 @@ #include <qwizard.h> #include <qlibrary.h> #include <private/qstylehelper_p.h> +#include <private/qstyleanimation_p.h> QT_BEGIN_NAMESPACE @@ -1759,9 +1760,11 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o } else { Q_D(const QCleanlooksStyle); int slideWidth = ((rect.width() - 4) * 2) / 3; - int step = ((d->animateStep * slideWidth) / d->animationFps) % slideWidth; - if ((((d->animateStep * slideWidth) / d->animationFps) % (2 * slideWidth)) >= slideWidth) - step = slideWidth - step; + int step = 0; +#ifndef QT_NO_ANIMATION + if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(widget))) + step = animation->progressStep(slideWidth); +#endif progressBar.setRect(rect.left() + 1 + step, rect.top() + 1, slideWidth / 2, rect.height() - 3); } |