aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-22 10:37:50 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-22 09:47:49 +0000
commit0f13f8d2ed2a207c5f8aaefc9118d6ed0e692e0e (patch)
treeda4075ffe1a9323ca07223587e6b283432dd03f7
parent89e0581ad48f2e242354e73c8e09f6feb792bccb (diff)
Don't leak wheel events through modal popups
Change-Id: Ib7768d2efd25583fff66c0e4169a3454aaa6cf9d Task-number: QTBUG-50577 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
-rw-r--r--src/templates/qquickoverlay.cpp6
-rw-r--r--src/templates/qquickoverlay_p.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/templates/qquickoverlay.cpp b/src/templates/qquickoverlay.cpp
index e06d28ea..ecee2767 100644
--- a/src/templates/qquickoverlay.cpp
+++ b/src/templates/qquickoverlay.cpp
@@ -240,6 +240,12 @@ void QQuickOverlay::mouseReleaseEvent(QMouseEvent *event)
emit released();
}
+void QQuickOverlay::wheelEvent(QWheelEvent *event)
+{
+ Q_D(QQuickOverlay);
+ event->setAccepted(d->modalPopups > 0);
+}
+
bool QQuickOverlay::childMouseEventFilter(QQuickItem *item, QEvent *event)
{
Q_D(QQuickOverlay);
diff --git a/src/templates/qquickoverlay_p.h b/src/templates/qquickoverlay_p.h
index a48b54ed..6a4d56b3 100644
--- a/src/templates/qquickoverlay_p.h
+++ b/src/templates/qquickoverlay_p.h
@@ -80,6 +80,7 @@ protected:
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
bool childMouseEventFilter(QQuickItem *item, QEvent *event) Q_DECL_OVERRIDE;
private: