summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qfusionstyle.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-05-07 13:07:34 +0200
committerLiang Qi <liang.qi@qt.io>2017-05-07 13:08:18 +0200
commitd1ea4813458b383e66ce4df69d1833b8b6a279c4 (patch)
tree3bdc16da993e5de56b669e6774fb0748075ddd90 /src/widgets/styles/qfusionstyle.cpp
parent1c87d4e1a1d0e1972f6dc85e55ea9be8a42797ba (diff)
parent0b1ec78c2d4871afcc89d5b046926b88f0819a7c (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/network/access/qnetworkreply.cpp tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp Change-Id: Iadf766269454087e69fb216fc3857d85b0ddfaad
Diffstat (limited to 'src/widgets/styles/qfusionstyle.cpp')
-rw-r--r--src/widgets/styles/qfusionstyle.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index e1158b9a16..1120958b87 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -2409,9 +2409,11 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
qreal expandOffset = -1.0;
QObject *styleObject = option->styleObject;
if (styleObject && proxy()->styleHint(SH_ScrollBar_Transient, option, widget)) {
+#if QT_CONFIG(animation)
qreal opacity = 0.0;
bool shouldExpand = false;
const qreal maxExpandScale = 13.0 / 9.0;
+#endif
int oldPos = styleObject->property("_q_stylepos").toInt();
int oldMin = styleObject->property("_q_stylemin").toInt();
@@ -2432,10 +2434,6 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
oldState != scrollBar->state ||
oldActiveControls != scrollBar->activeSubControls) {
- // if the scrollbar is transient or its attributes, geometry or
- // state has changed, the opacity is reset back to 100% opaque
- opacity = 1.0;
-
styleObject->setProperty("_q_stylepos", scrollBar->sliderPosition);
styleObject->setProperty("_q_stylemin", scrollBar->minimum);
styleObject->setProperty("_q_stylemax", scrollBar->maximum);
@@ -2444,6 +2442,10 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
styleObject->setProperty("_q_stylecontrols", static_cast<uint>(scrollBar->activeSubControls));
#ifndef QT_NO_ANIMATION
+ // if the scrollbar is transient or its attributes, geometry or
+ // state has changed, the opacity is reset back to 100% opaque
+ opacity = 1.0;
+
QScrollbarStyleAnimation *anim = qobject_cast<QScrollbarStyleAnimation *>(d->animation(styleObject));
if (transient) {
if (!anim) {