From 1735ca57a8c32e166f24cd8d39abc6583bbebf00 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Tue, 5 Apr 2016 11:27:53 +0300 Subject: [PATCH] Fix slow scrolling by wheel after setting a custom scrollbar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bug was introduced by 410aa20f073b5e45e73366773b7d173f840a9cfe (QAIV - allow users to control single step in ScrollPerPixel mode). QAbstractSliderPrivate::viewMayChangeSingleStep is reponsible for the expected behavior when scrolling by wheel. It is set to true by default, but calling QAbstractScrollArea::set*ScrollBar() results to always setting it to false. So we should copy viewMayChangeSingleStep manually from the old scrollbar. Change-Id: I2ee218054e473fa96785b123805e3943a5d74dbd Reviewed-by: Thorbjørn Lund Martsum --- src/widgets/widgets/qabstractscrollarea.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index 3a06860e364..2ad9f88e6b7 100644 --- a/src/widgets/widgets/qabstractscrollarea.cpp +++ b/src/widgets/widgets/qabstractscrollarea.cpp @@ -269,6 +269,7 @@ void QAbstractScrollAreaPrivate::replaceScrollBar(QScrollBar *scrollBar, scrollBar->setOrientation(oldBar->orientation()); scrollBar->setPageStep(oldBar->pageStep()); scrollBar->setSingleStep(oldBar->singleStep()); + scrollBar->d_func()->viewMayChangeSingleStep = oldBar->d_func()->viewMayChangeSingleStep; scrollBar->setSliderDown(oldBar->isSliderDown()); scrollBar->setSliderPosition(oldBar->sliderPosition()); scrollBar->setTracking(oldBar->hasTracking());