diff options
author | Alexander Volkov <a.volkov@rusbitech.ru> | 2016-04-05 11:27:53 +0300 |
---|---|---|
committer | Alexander Volkov <a.volkov@rusbitech.ru> | 2016-04-05 22:01:42 +0000 |
commit | 1735ca57a8c32e166f24cd8d39abc6583bbebf00 (patch) | |
tree | a5af6d434a9f42ca316226a5448e45b42d271aeb /src/widgets/widgets/qabstractscrollarea.cpp | |
parent | a057d42305072158d79eb74450e97542e3c0da5a (diff) |
Fix slow scrolling by wheel after setting a custom scrollbar
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 <tmartsum@gmail.com>
Diffstat (limited to 'src/widgets/widgets/qabstractscrollarea.cpp')
-rw-r--r-- | src/widgets/widgets/qabstractscrollarea.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index 3a06860e36..2ad9f88e6b 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()); |