From 2f402e4d099c0175cf79e95b624dedad7384062d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 16 Oct 2015 15:04:49 +0200 Subject: Ensure QWindow::create() creates parent hierarchy before creating self To be able to create a platform window for a given QWindow we need to sync up the parent hierarchy first, so that the newly created window can be placed into that hierarchy. Without creating the parent hierarchy first, the QPlatformWindow will end up thinking it's a top level window, when in reality is represents the platform backing of a child QWindow. Change-Id: I2cad7759fbc118b04718e7a27ec7570ce1238757 Reviewed-by: Lars Knoll --- src/gui/kernel/qwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index e262f3f8a4..ec2e3e7367 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -392,6 +392,9 @@ void QWindowPrivate::create(bool recursive) if (platformWindow) return; + if (q->parent()) + q->parent()->create(); + platformWindow = QGuiApplicationPrivate::platformIntegration()->createPlatformWindow(q); Q_ASSERT(platformWindow); -- cgit v1.2.3