summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLambert Duijst <lambertduijst@hotmail.com>2016-12-08 11:07:07 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-12-13 00:42:09 +0000
commit00c9ec63a552d040e851b561c11428fabf1a2b08 (patch)
treefe189a282b003ca755f924e5864335cfb2ddeddb
parentee7a5a94f9bb0e56053603c6727202af0e851aa4 (diff)
Fix for horizontal scrollbars
Horizontal scrollbars scroll in the wrong direction when the app has a stylesheet and the LayoutDirection is RightToLeft. Change-Id: I860cb733709e8d59a7b844f2b6ed1ee63410956e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 8e77ae0e44..d63c96bf0e 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -5542,9 +5542,9 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp
} else {
sliderlen = maxlen;
}
-
+ const int sliderPosition = sb->orientation == Qt::Horizontal && sb->direction == Qt::RightToLeft ? sb->maximum - sb->sliderPosition + sb->minimum : sb->sliderPosition;
int sliderstart = (styleOptionSlider.orientation == Qt::Horizontal ? contentRect.left() : contentRect.top())
- + sliderPositionFromValue(sb->minimum, sb->maximum, sb->sliderPosition,
+ + sliderPositionFromValue(sb->minimum, sb->maximum, sliderPosition,
maxlen - sliderlen, sb->upsideDown);
QRect sr = (sb->orientation == Qt::Horizontal)