From 00c9ec63a552d040e851b561c11428fabf1a2b08 Mon Sep 17 00:00:00 2001 From: Lambert Duijst Date: Thu, 8 Dec 2016 11:07:07 +0100 Subject: [PATCH] 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 --- src/widgets/styles/qstylesheetstyle.cpp | 4 ++-- 1 file 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)