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>
This commit is contained in:
parent
1511fb37cf
commit
04d296d641
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user