summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qscrollbar.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2012-09-25 10:54:11 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-09-26 19:06:47 +0200
commitaec5b76b51fb1895f275ac4d413cc040cf88d519 (patch)
tree57b5f8d58778bb5d9c29b769e0b729888cee838d /src/widgets/widgets/qscrollbar.h
parentd535c910e443b974f0070cea2b3b000190450268 (diff)
[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>
Diffstat (limited to 'src/widgets/widgets/qscrollbar.h')
-rw-r--r--src/widgets/widgets/qscrollbar.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widgets/widgets/qscrollbar.h b/src/widgets/widgets/qscrollbar.h
index 95943f2676..48863616ff 100644
--- a/src/widgets/widgets/qscrollbar.h
+++ b/src/widgets/widgets/qscrollbar.h
@@ -67,6 +67,9 @@ public:
bool event(QEvent *event);
protected:
+#ifndef QT_NO_WHEELEVENT
+ void wheelEvent(QWheelEvent *);
+#endif
void paintEvent(QPaintEvent *);
void mousePressEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);