aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/quicktemplates2/qquickpopup.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp
index 3f3caf58..4852d08d 100644
--- a/src/quicktemplates2/qquickpopup.cpp
+++ b/src/quicktemplates2/qquickpopup.cpp
@@ -2216,8 +2216,12 @@ void QQuickPopup::componentComplete()
{
Q_D(QQuickPopup);
d->complete = true;
- if (!parentItem())
- setParentItem(qobject_cast<QQuickItem *>(parent()));
+ if (!parentItem()) {
+ if (QQuickItem *item = qobject_cast<QQuickItem *>(parent()))
+ setParentItem(item);
+ else if (QQuickWindow *window = qobject_cast<QQuickWindow *>(parent()))
+ setParentItem(window->contentItem());
+ }
if (d->visible)
d->transitionManager.transitionEnter();
d->popupItem->componentComplete();