summaryrefslogtreecommitdiff
path: root/src/controls/qquickmenupopupwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/controls/qquickmenupopupwindow.cpp')
-rw-r--r--src/controls/qquickmenupopupwindow.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/controls/qquickmenupopupwindow.cpp b/src/controls/qquickmenupopupwindow.cpp
index bdc8fc25..b8c10b66 100644
--- a/src/controls/qquickmenupopupwindow.cpp
+++ b/src/controls/qquickmenupopupwindow.cpp
@@ -80,12 +80,21 @@ void QQuickMenuPopupWindow::setParentWindow(QWindow *effectiveParentWindow, QQui
setTransientParent(effectiveParentWindow);
m_logicalParentWindow = parentWindow;
if (parentWindow) {
- connect(parentWindow, SIGNAL(destroyed()), this, SLOT(dismissPopup()));
- if (QQuickMenuPopupWindow *pw = qobject_cast<QQuickMenuPopupWindow *>(parentWindow))
+ if (QQuickMenuPopupWindow *pw = qobject_cast<QQuickMenuPopupWindow *>(parentWindow)) {
connect(pw, SIGNAL(popupDismissed()), this, SLOT(dismissPopup()));
+ connect(pw, SIGNAL(willBeDeletedLater()), this, SLOT(setToBeDeletedLater()));
+ } else {
+ connect(parentWindow, SIGNAL(destroyed()), this, SLOT(deleteLater()));
+ }
}
}
+void QQuickMenuPopupWindow::setToBeDeletedLater()
+{
+ deleteLater();
+ emit willBeDeletedLater();
+}
+
void QQuickMenuPopupWindow::setGeometry(int posx, int posy, int w, int h)
{
QWindow *pw = transientParent();