diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2014-12-11 09:47:43 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-01-12 21:09:26 +0100 |
commit | ea9a366d3f01262f32134d1e9f7853d17832dbac (patch) | |
tree | c0bc592098eabad82d50589c1a0dd94212d0d6af /src/widgets | |
parent | be5cfa960b617fb31a2a1f4ce850c35dcb23fde5 (diff) |
Swallow wheel events while a popup widget is open.
Wheel events should not cause a popup widget parented on a scrollable
widget to be closed or moved to correctly reflect the system behavior
on OS X and Windows.
Task-number: QTBUG-42731
Task-number: QTBUG-40656
Change-Id: I4ef75aa8331390309c251316ac76db2cf9ec51f7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index b7d0869289..abd0231b00 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -3320,12 +3320,10 @@ bool QApplication::notify(QObject *receiver, QEvent *e) QWidget* w = static_cast<QWidget *>(receiver); QWheelEvent* wheel = static_cast<QWheelEvent*>(e); - // QTBUG-40656, combo and other popups should close when the main window gets a wheel event. - while (QWidget *popup = QApplication::activePopupWidget()) { + // QTBUG-40656, QTBUG-42731: ignore wheel events when a popup (QComboBox) is open. + if (const QWidget *popup = QApplication::activePopupWidget()) { if (w->window() != popup) - popup->close(); - else - break; + return true; } QPoint relpos = wheel->pos(); |