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:
parent
940530ab67
commit
ce84a1bde3
@ -728,7 +728,7 @@ bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::Keyb
|
|||||||
stepsToScroll = -stepsToScroll;
|
stepsToScroll = -stepsToScroll;
|
||||||
|
|
||||||
int prevValue = value;
|
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);
|
q->triggerAction(QAbstractSlider::SliderMove);
|
||||||
|
|
||||||
if (prevValue == value) {
|
if (prevValue == value) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user