void QQuickMenuPopupWindow::setParentWindow(QQuickWindow *parentWindow) { if (transientParent() != parentWindow) setTransientParent(parentWindow); if (parentWindow) { connect(parentWindow, SIGNAL(destroyed()), this, SLOT(dismissPopup())); if (QQuickMenuPopupWindow *pw = qobject_cast<QQuickMenuPopupWindow *>(parentWindow)) connect(pw, SIGNAL(popupDismissed()), this, SLOT(dismissPopup())); } }
void QQuickPopupWindow::setParentItem(QQuickItem *item) { m_parentItem = item; if (m_parentItem) setTransientParent(m_parentItem->window()); }