aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-09-06 16:59:39 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-09-13 06:51:35 +0000
commitb3619f32c20b5851ada0826ec2e7ddc2ec8a210b (patch)
tree65c9332b68b808d8df984c6b325ede44c168b501 /src
parentdb018c5cc71f5f62bcce7df4f2bed76b2899884d (diff)
Fix modal overlays leaking wheel events through
Change-Id: I1a3be5ef02cf73a153cebc030313f892fbb03d9f Task-number: QTBUG-55769 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quicktemplates2/qquickdrawer.cpp2
-rw-r--r--src/quicktemplates2/qquickoverlay.cpp16
-rw-r--r--src/quicktemplates2/qquickoverlay_p.h1
3 files changed, 18 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp
index 15b53914..be4d624d 100644
--- a/src/quicktemplates2/qquickdrawer.cpp
+++ b/src/quicktemplates2/qquickdrawer.cpp
@@ -527,7 +527,7 @@ bool QQuickDrawer::overlayEvent(QQuickItem *item, QEvent *event)
d->tryClose(item, static_cast<QMouseEvent *>(event));
return d->handleMouseReleaseEvent(item, static_cast<QMouseEvent *>(event));
default:
- return false;
+ return QQuickPopup::overlayEvent(item, event);
}
}
diff --git a/src/quicktemplates2/qquickoverlay.cpp b/src/quicktemplates2/qquickoverlay.cpp
index 19677cb7..c6e34ee2 100644
--- a/src/quicktemplates2/qquickoverlay.cpp
+++ b/src/quicktemplates2/qquickoverlay.cpp
@@ -379,6 +379,22 @@ void QQuickOverlay::mouseReleaseEvent(QMouseEvent *event)
}
}
+void QQuickOverlay::wheelEvent(QWheelEvent *event)
+{
+ Q_D(QQuickOverlay);
+ if (d->mouseGrabberPopup) {
+ d->mouseGrabberPopup->overlayEvent(this, event);
+ return;
+ } else {
+ const auto popups = d->stackingOrderPopups();
+ for (QQuickPopup *popup : popups) {
+ if (popup->overlayEvent(this, event))
+ return;
+ }
+ }
+ event->ignore();
+}
+
bool QQuickOverlay::childMouseEventFilter(QQuickItem *item, QEvent *event)
{
Q_D(QQuickOverlay);
diff --git a/src/quicktemplates2/qquickoverlay_p.h b/src/quicktemplates2/qquickoverlay_p.h
index 07f7daec..af16900f 100644
--- a/src/quicktemplates2/qquickoverlay_p.h
+++ b/src/quicktemplates2/qquickoverlay_p.h
@@ -87,6 +87,7 @@ protected:
void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
+ void wheelEvent(QWheelEvent *event) override;
bool childMouseEventFilter(QQuickItem *item, QEvent *event) override;
private: