summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidget_qpa.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qwidget_qpa.cpp')
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index ae8a0b25b9..93234f3958 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -53,6 +53,7 @@
#include <qpa/qplatformintegration.h>
#include "QtGui/private/qwindow_p.h"
#include "QtGui/private/qguiapplication_p.h"
+#include <private/qwindowcontainer_p.h>
#include <qpa/qplatformcursor.h>
#include <QtGui/QGuiApplication>
@@ -267,8 +268,11 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f)
bool explicitlyHidden = q->testAttribute(Qt::WA_WState_Hidden) && q->testAttribute(Qt::WA_WState_ExplicitShowHide);
// Reparenting toplevel to child
- if (wasCreated && !(f & Qt::Window) && (oldFlags & Qt::Window) && !q->testAttribute(Qt::WA_NativeWindow))
+ if (wasCreated && !(f & Qt::Window) && (oldFlags & Qt::Window) && !q->testAttribute(Qt::WA_NativeWindow)) {
+ if (extra && extra->hasWindowContainer)
+ QWindowContainer::toplevelAboutToBeDestroyed(q);
q->destroy();
+ }
adjustFlags(f, q);
data.window_flags = f;