diff options
author | Rafael Roquetto <rafael.roquetto.qnx@kdab.com> | 2012-09-27 18:24:16 -0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-01 09:41:35 +0200 |
commit | 04d296d64118ba2d647668494872d93cc1ef7ed1 (patch) | |
tree | e753893a34562c70c239fc715a2a2db5b681c19e /src/plugins | |
parent | 1511fb37cf5a15fbc1fd498ff122988cc0ef83c3 (diff) |
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 <thomas.mcguire@kdab.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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()); |