diff options
Diffstat (limited to 'src/controls/qquickpopupwindow.cpp')
| -rw-r--r-- | src/controls/qquickpopupwindow.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/controls/qquickpopupwindow.cpp b/src/controls/qquickpopupwindow.cpp index ec0ab07c2..8db737015 100644 --- a/src/controls/qquickpopupwindow.cpp +++ b/src/controls/qquickpopupwindow.cpp @@ -178,19 +178,28 @@ void QQuickPopupWindow::mouseReleaseEvent(QMouseEvent *e) void QQuickPopupWindow::forwardEventToTransientParent(QMouseEvent *e) { + bool forwardEvent = true; + if (!qobject_cast<QQuickPopupWindow*>(transientParent()) && ((m_mouseMoved && e->type() == QEvent::MouseButtonRelease) || e->type() == QEvent::MouseButtonPress)) { // Clicked outside any popup dismissPopup(); + forwardEvent = shouldForwardEventAfterDismiss(e); } - if (transientParent()) { + + if (forwardEvent && transientParent()) { QPoint parentPos = transientParent()->mapFromGlobal(mapToGlobal(e->pos())); QMouseEvent pe = QMouseEvent(e->type(), parentPos, e->button(), e->buttons(), e->modifiers()); QGuiApplication::sendEvent(transientParent(), &pe); } } +bool QQuickPopupWindow::shouldForwardEventAfterDismiss(QMouseEvent*) const +{ + return false; +} + void QQuickPopupWindow::exposeEvent(QExposeEvent *e) { if (isExposed() && m_needsActivatedEvent) { |
