diff options
author | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-10-16 15:04:49 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-10-26 13:12:35 +0000 |
commit | 2f402e4d099c0175cf79e95b624dedad7384062d (patch) | |
tree | 9962851839ac989d0e6e0e6635994cd155bc913b /src/gui/kernel/qwindow.cpp | |
parent | d669bde4bf32b19e317b6f58077f406a7d0e12e0 (diff) |
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 <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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); |