diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-04-26 10:35:00 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-04-26 15:53:36 +0000 |
commit | cf67bb976e082105994ff00a2616129833edb857 (patch) | |
tree | f3f2cf2d278a12f60e63e14a00d38cb455424013 /src/quicktemplates2/qquickoverlay.cpp | |
parent | 927b1280bb33a240c33a54d8e72531ab606ac590 (diff) |
Popups: fix non-dimming modal background leaking events through
This piece of code, which was thought unnecessary, went missing when
moved from mousePressEvent() to handlePress() in 7faafa4. It is needed
after all for non-dimming modal popups, because in that case we simply
cannot rely on the background dimming blocking the press...
Task-number: QTBUG-60405
Change-Id: I53d89133eeae4ad8531b3c1e07c3b22295d438de
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickoverlay.cpp')
-rw-r--r-- | src/quicktemplates2/qquickoverlay.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/quicktemplates2/qquickoverlay.cpp b/src/quicktemplates2/qquickoverlay.cpp index 58ec5582..10ac3623 100644 --- a/src/quicktemplates2/qquickoverlay.cpp +++ b/src/quicktemplates2/qquickoverlay.cpp @@ -201,10 +201,15 @@ void QQuickOverlayPrivate::handlePress(QEvent *event) } if (!mouseGrabberPopup) { - // allow non-modal popups to close themselves + // allow non-modal popups to close themselves, + // and non-dimming modal popups to block the event const auto popups = stackingOrderPopups(); - for (QQuickPopup *popup : popups) - popup->overlayEvent(q, event); + for (QQuickPopup *popup : popups) { + if (popup->overlayEvent(q, event)) { + setMouseGrabberPopup(popup); + return; + } + } } event->ignore(); |