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>
This commit is contained in:
Lambert Duijst 2016-12-08 11:07:07 +01:00 committed by Allan Sandfeld Jensen
parent ee7a5a94f9
commit 00c9ec63a5

View File

@ -5542,9 +5542,9 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp
} else { } else {
sliderlen = maxlen; 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()) 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); maxlen - sliderlen, sb->upsideDown);
QRect sr = (sb->orientation == Qt::Horizontal) QRect sr = (sb->orientation == Qt::Horizontal)