diff options
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 5529f8f72c..2d12674c29 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1362,11 +1362,11 @@ void q_createNativeChildrenAndSetParent(const QWidget *parentWidget) if (!childWidget->internalWinId()) childWidget->winId(); if (childWidget->windowHandle()) { - QWindow *parentWindow = childWidget->nativeParentWidget()->windowHandle(); - if (childWidget->isWindow()) - childWidget->windowHandle()->setTransientParent(parentWindow); - else - childWidget->windowHandle()->setParent(parentWindow); + if (childWidget->isWindow()) { + childWidget->windowHandle()->setTransientParent(parentWidget->window()->windowHandle()); + } else { + childWidget->windowHandle()->setParent(childWidget->nativeParentWidget()->windowHandle()); + } } } else { q_createNativeChildrenAndSetParent(childWidget); |