summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2012-09-25 09:09:05 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-09-27 22:03:27 (GMT)
commita5beb5af606110df111be6e8321ebdd1c548db7f (patch)
tree53c3e8f869ba1b3dae9aac22c34f289c92aa9710 /src/gui/widgets
parent853ef83dfa6f07354276266816ff766bd8a16233 (diff)
downloadQt-a5beb5af606110df111be6e8321ebdd1c548db7f.zip
Qt-a5beb5af606110df111be6e8321ebdd1c548db7f.tar.gz
Qt-a5beb5af606110df111be6e8321ebdd1c548db7f.tar.bz2
[QTBUG-27308][QTBUG-21534] Don't mouse-wheel-scroll QScrollBar when disabled
The Qt 5 fix (aec5b76) doesn't apply here, because it introduces a new symbol that might break forward compatibility if code compiled against a newer Qt 4.8 is run against an older Qt 4.8, and QScrollBar::wheelEvent() ends up being devirtualised. So copy the guard clause from QWidget::event() here. Task-number: QTBUG-27308 Reported-by: chenjiexin Task-number: QTBUG-21534 Reported-by: Martin Koller Change-Id: I5d2f823c65bae8cff33bac320c37e6496b14646c Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qscrollbar.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/widgets/qscrollbar.cpp b/src/gui/widgets/qscrollbar.cpp
index 02d584c..0157126 100644
--- a/src/gui/widgets/qscrollbar.cpp
+++ b/src/gui/widgets/qscrollbar.cpp
@@ -524,6 +524,8 @@ bool QScrollBar::event(QEvent *event)
case QEvent::Wheel: {
event->ignore();
// override wheel event without adding virtual function override
+ if (!isEnabled()) // don't scroll when disabled [QTBUG-27308]
+ return false; // normally prevented in QWidget::event()
QWheelEvent *ev = static_cast<QWheelEvent *>(event);
int delta = ev->delta();
// scrollbar is a special case - in vertical mode it reaches minimum