Пример #1
0
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()));
    }
}
Пример #2
0
void QQuickPopupWindow::setParentItem(QQuickItem *item)
{
    m_parentItem = item;
    if (m_parentItem)
        setTransientParent(m_parentItem->window());
}