From 04d296d64118ba2d647668494872d93cc1ef7ed1 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Thu, 27 Sep 2012 18:24:16 -0300 Subject: [PATCH] QNX: Only set parent window if it is not NULL There are cases where a widget has a parent, but is also a toplevel window at the same time, causing the system window to have no parent. For instance, a QMenu usually has a QMenuBar as a parent, however QMenuBar itself does not have its own platform window, as opposed to QMenu. Thus QMenuBar::parent == QMainWindow (for example), but QMenuBar::platformWindow == 0x0; QMenu::parent == QMenuBar, but QMenu::platformWindow != 0x0 (which is QMenuBar's value). Change-Id: Ib203fa1b85f5f20ef53366c80d6752d6384a202d Reviewed-by: Thomas McGuire --- src/plugins/platforms/qnx/qqnxwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index ed3fc5b67b..c7d17875fa 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -138,7 +138,7 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context) // Qt never calls these setters after creating the window, so we need to do that ourselves here setWindowState(window->windowState()); - if (window->parent()) + if (window->parent() && window->parent()->handle()) setParent(window->parent()->handle()); setGeometryHelper(window->geometry()); setVisible(window->isVisible());