summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstylesheetstyle.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-11-21 23:59:03 +0100
committerLiang Qi <liang.qi@qt.io>2018-11-22 01:53:29 +0100
commitbf58c70546c5f9cb66d99b82abfde9ba1a056192 (patch)
treedf3675d3377ef6576f82fb167ebd67fcc900a91b /src/widgets/styles/qstylesheetstyle.cpp
parent37f617c405ae4f26cbb6bb4f08d61d6ccc111a98 (diff)
parent41cba737a98b16a2767c55cda0532f38b6b6a37d (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts: src/corelib/io/qdir.cpp src/corelib/kernel/qtimer.cpp src/corelib/kernel/qtimer.h Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I683d897760ec06593136d77955f8bc87fdef3f9f
Diffstat (limited to 'src/widgets/styles/qstylesheetstyle.cpp')
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 121de548b0..5ed7195b60 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -5641,22 +5641,18 @@ 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, sliderPosition,
+ + sliderPositionFromValue(sb->minimum, sb->maximum, sb->sliderPosition,
maxlen - sliderlen, sb->upsideDown);
QRect sr = (sb->orientation == Qt::Horizontal)
? QRect(sliderstart, contentRect.top(), sliderlen, contentRect.height())
: QRect(contentRect.left(), sliderstart, contentRect.width(), sliderlen);
- if (sc == SC_ScrollBarSlider) {
- return sr;
- } else if (sc == SC_ScrollBarSubPage) {
- return QRect(contentRect.topLeft(), sb->orientation == Qt::Horizontal ? sr.bottomLeft() : sr.topRight());
- } else { // SC_ScrollBarAddPage
- return QRect(sb->orientation == Qt::Horizontal ? sr.topRight() : sr.bottomLeft(), contentRect.bottomRight());
- }
- break;
+ if (sc == SC_ScrollBarSubPage)
+ sr = QRect(contentRect.topLeft(), sb->orientation == Qt::Horizontal ? sr.bottomLeft() : sr.topRight());
+ else if (sc == SC_ScrollBarAddPage)
+ sr = QRect(sb->orientation == Qt::Horizontal ? sr.topRight() : sr.bottomLeft(), contentRect.bottomRight());
+ return visualRect(styleOptionSlider.direction, grooveRect, sr);
}
case SC_ScrollBarAddLine: pe = PseudoElement_ScrollBarAddLine; break;
case SC_ScrollBarSubLine: pe = PseudoElement_ScrollBarSubLine; break;