[QTBUG-27308][QTBUG-21534] Don't mouse-wheel-scroll QScrollBar when disabled
authorMarc Mutz <marc.mutz@kdab.com>
Tue, 25 Sep 2012 08:54:11 +0000 (10:54 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 26 Sep 2012 17:06:47 +0000 (19:06 +0200)
commitaec5b76b51fb1895f275ac4d413cc040cf88d519
tree57b5f8d58778bb5d9c29b769e0b729888cee838d
parentd535c910e443b974f0070cea2b3b000190450268
[QTBUG-27308][QTBUG-21534] Don't mouse-wheel-scroll QScrollBar when disabled

This fixes a regression introduced in Qt 4 commit
e855b199319c932f2e9500235775f961bc32e41a.

The problem was that by handling the wheel event in event()
instead of wheelEvent(), we lack the guard clause in QWidget
that doesn't even call the handler if the widget is disabled,
and the code didn't handle this itself.

Fix by reimplementing wheelEvent() instead, which we can now
do because we can break BC.

This commit just moves the code. Another commit will clean
up the implementation of wheelEvent().

Task-number: QTBUG-27308
Reported-by: chenjiexin
Task-number: QTBUG-21534
Reported-by: Martin Koller
Change-Id: Ibe6b89a81fe889f839c205b859a1492b39a4ddc3
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
src/widgets/widgets/qscrollbar.cpp
src/widgets/widgets/qscrollbar.h
tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp