diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2017-01-26 15:12:42 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2017-01-30 11:39:08 +0000 |
commit | bec3658e19a8028fbc50c6cca9615e5ca052adb2 (patch) | |
tree | c57491b794ff97736f615abbf6f8133680a0ad0d /src | |
parent | 77b33e4b856c8c60993c0d65ad32c146e98c6701 (diff) |
Fix build with -no-feature-animation
Change-Id: Ieecb9cdbf4373e295148ae5b3d59c43aaf46175e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 5 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsstyle.cpp | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index d9d270643c..9be19b2679 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -3916,10 +3916,12 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q if (pb->minimum == 0 && pb->maximum == 0) { int chunkCount = fillWidth/chunkWidth; int offset = 0; +#if QT_CONFIG(animation) if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(opt->styleObject))) offset = animation->animationStep() * 8 % rect.width(); else d->startAnimation(new QProgressStyleAnimation(d->animationFps, opt->styleObject)); +#endif int x = reverse ? r.left() + r.width() - offset - chunkWidth : r.x() + offset; while (chunkCount > 0) { r.setRect(x, rect.y(), chunkWidth, rect.height()); @@ -3950,8 +3952,9 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q subRule.drawRule(p, r); x += reverse ? -chunkWidth : chunkWidth; } - +#if QT_CONFIG(animation) d->stopAnimation(opt->styleObject); +#endif } p->restore(); diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index f9370a2cc7..0ce8dde74c 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -1729,10 +1729,12 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai int step = 0; int chunkCount = w / unit_width + 1; +#if QT_CONFIG(animation) if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(opt->styleObject))) step = (animation->animationStep() / 3) % chunkCount; else d->startAnimation(new QProgressStyleAnimation(d->animationFps, opt->styleObject)); +#endif int chunksInRow = 5; int myY = pbBits.rect.y(); int myHeight = pbBits.rect.height(); @@ -1766,7 +1768,9 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai p->restore(); //restore state } else { +#if QT_CONFIG(animation) d->stopAnimation(opt->styleObject); +#endif QCommonStyle::drawControl(ce, opt, p, widget); } } |