diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-04-15 09:28:09 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-04-15 09:28:09 +0200 |
commit | cb6ccf9fee26c5a2b7f3946b7ffc05430b7be3ff (patch) | |
tree | 6de74ca46c389328696831bcc74cd5aff6756fee /src/controls/qquickmenupopupwindow.cpp | |
parent | ded73ee2ae8aa333894ab11ce2297e755ec03f3e (diff) | |
parent | de9145dcd904068256e28e130fdfda2e8014efe8 (diff) | |
download | qtquickcontrols-cb6ccf9fee26c5a2b7f3946b7ffc05430b7be3ff.tar.gz |
Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
src/controls/qquickmenupopupwindow_p.h
Change-Id: Ic935bb56f5df70645eea30c890759f5980d68fe4
Diffstat (limited to 'src/controls/qquickmenupopupwindow.cpp')
-rw-r--r-- | src/controls/qquickmenupopupwindow.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/controls/qquickmenupopupwindow.cpp b/src/controls/qquickmenupopupwindow.cpp index c43ea233..e28e63b1 100644 --- a/src/controls/qquickmenupopupwindow.cpp +++ b/src/controls/qquickmenupopupwindow.cpp @@ -86,12 +86,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(); @@ -99,7 +108,7 @@ void QQuickMenuPopupWindow::setGeometry(int posx, int posy, int w, int h) pw = parentItem()->window(); if (!pw) pw = this; - QRect g = pw->screen()->virtualGeometry(); + QRect g = pw->screen()->geometry(); if (posx + w > g.right()) { if (qobject_cast<QQuickMenuPopupWindow *>(transientParent())) { |