summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-01-10 20:01:38 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-01-14 00:46:43 +0100
commitce84a1bde3a1af536ebb95d2f6dd947fee248279 (patch)
tree6b130ce947e507461fb2fc44a3267c574fb63f56 /src/widgets
parent940530ab67a8fd59130b2299fe854707207f041f (diff)
Reduce excessive painting caused by transient scrollbars
The step logic in scrollByDelta() made scrollbar position to go temporarily outside its min/max boundaries, and then setValue() corrected it immediately back within its bounds. The false change notifications caused by this position vs. value ping pong caused plenty of unnecessary updates. Task-number: QTBUG-30316 Change-Id: I32dd5bdb7b0c578dfc5dfa1deecceb19bb98a2b3 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/widgets/qabstractslider.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/widgets/qabstractslider.cpp b/src/widgets/widgets/qabstractslider.cpp
index d9dae9d775..fccdd24c39 100644
--- a/src/widgets/widgets/qabstractslider.cpp
+++ b/src/widgets/widgets/qabstractslider.cpp
@@ -728,7 +728,7 @@ bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::Keyb
stepsToScroll = -stepsToScroll;
int prevValue = value;
- position = overflowSafeAdd(stepsToScroll); // value will be updated by triggerAction()
+ position = bound(overflowSafeAdd(stepsToScroll)); // value will be updated by triggerAction()
q->triggerAction(QAbstractSlider::SliderMove);
if (prevValue == value) {