summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r--src/widgets/kernel/qwidget.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 6131491aaa1..c0896e87d99 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -10908,10 +10908,12 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
<< "to support" << surfaceType;
const auto windowStateBeforeDestroy = newParentWithWindow->windowState();
const auto visibilityBeforeDestroy = newParentWithWindow->isVisible();
+ const auto positionBeforeDestroy = newParentWithWindow->pos();
newParentWithWindow->destroy();
newParentWithWindow->create();
Q_ASSERT(newParentWithWindow->windowHandle());
newParentWithWindow->windowHandle()->setWindowStates(windowStateBeforeDestroy);
+ newParentWithWindow->move(positionBeforeDestroy);
QWidgetPrivate::get(newParentWithWindow)->setVisible(visibilityBeforeDestroy);
} else if (auto *backingStore = newParentWithWindow->backingStore()) {
// If we don't recreate we still need to make sure the native parent