Fixed closing popup if parent popup was closed
This commit is contained in:
parent
2b3d4b9b36
commit
95262cc4b2
3 changed files with 8 additions and 2 deletions
|
@ -157,8 +157,6 @@ ListItemBlank {
|
|||
menu.model = modelData.subitems
|
||||
menu.anchorItem = root.menuAnchorItem
|
||||
|
||||
menu.setParentWindow(root.parentWindow)
|
||||
|
||||
menu.handleMenuItem.connect(function(itemId) {
|
||||
Qt.callLater(root.handleMenuItem, itemId)
|
||||
menu.close()
|
||||
|
|
|
@ -692,6 +692,8 @@ void PopupView::resolveNavigationParentControl()
|
|||
connect(qmlCtrl, &QObject::destroyed, this, [this]() {
|
||||
setNavigationParentControl(nullptr);
|
||||
});
|
||||
|
||||
setParentWindow(ctrl->window());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -121,6 +121,12 @@ void PopupWindow_QQuickView::show(QScreen* screen, QPoint position, bool activat
|
|||
QWindow* parent = m_parentWindow ? m_parentWindow : interactiveProvider()->topWindow();
|
||||
m_view->setTransientParent(parent);
|
||||
|
||||
connect(parent, &QWindow::visibleChanged, this, [this](){
|
||||
if (!m_view->transientParent() || !m_view->transientParent()->isVisible()) {
|
||||
close();
|
||||
}
|
||||
});
|
||||
|
||||
m_view->show();
|
||||
|
||||
if (activateFocus) {
|
||||
|
|
Loading…
Reference in a new issue