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>
This commit is contained in:
J-P Nurmi 2015-01-10 20:01:38 +01:00
parent 940530ab67
commit ce84a1bde3

View File

@ -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) {