From: Jens Bache-Wiig Date: Fri, 2 Nov 2012 13:18:54 +0000 (+0100) Subject: Fix progressbar animation on macstyle X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28f36ebcc246c90f82355bb0a40b3cca07913fae;p=profile%2Fivi%2Fqtbase.git Fix progressbar animation on macstyle The animation is not just supposed to run when indeterminate, but also while it is progressing. Change-Id: If176bd230c2f6f83781e01ea77526c24d54c8477 Reviewed-by: J-P Nurmi --- diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index b957650..dbd4cf2 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -4357,7 +4357,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter tdi.min = pb->minimum; tdi.value = pb->progress; tdi.attributes = vertical ? 0 : kThemeTrackHorizontal; - if (isIndeterminate) { + + if (isIndeterminate || tdi.value < tdi.max) { if (QProgressStyleAnimation *animation = qobject_cast(d->animation(opt->styleObject))) tdi.trackInfo.progress.phase = animation->animationStep(); else diff --git a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp index 7024da9..9ec249c 100644 --- a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp +++ b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp @@ -58,7 +58,9 @@ private slots: void text(); void format(); void setValueRepaint(); +#ifndef Q_OS_MAC void setMinMaxRepaint(); +#endif void sizeHint(); void formatedText_data(); void formatedText(); @@ -212,6 +214,10 @@ void tst_QProgressBar::setValueRepaint() } } +// This test is invalid on Mac, since progressbars +// are animated there + +#ifndef Q_OS_MAC void tst_QProgressBar::setMinMaxRepaint() { ProgressBar pbar; @@ -247,6 +253,7 @@ void tst_QProgressBar::setMinMaxRepaint() QTRY_VERIFY(pbar.repainted); } } +#endif //Q_OS_MAC void tst_QProgressBar::sizeHint() {