diff options
author | Rafael Roquetto <rafael.roquetto.qnx@kdab.com> | 2012-10-01 21:23:22 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-02 08:43:03 (GMT) |
commit | 2884acf635825929204ae1c470b80df304de2d67 (patch) | |
tree | 6b74265bcf1c27f60422937abfc806b300fb6dc9 /src/plugins | |
parent | 1c2d3a8ddca1455525508601e9a024a180b1be64 (diff) | |
download | Qt-2884acf635825929204ae1c470b80df304de2d67.zip Qt-2884acf635825929204ae1c470b80df304de2d67.tar.gz Qt-2884acf635825929204ae1c470b80df304de2d67.tar.bz2 |
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).
cherry-picked from qt5 04d296d64118ba2d647668494872d93cc1ef7ed1
Change-Id: I9304c5c9e64dca012a1903de7c80c168a701a5ea
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/blackberry/qbbwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/blackberry/qbbwindow.cpp b/src/plugins/platforms/blackberry/qbbwindow.cpp index 07a2f91..5d6a1c1 100644 --- a/src/plugins/platforms/blackberry/qbbwindow.cpp +++ b/src/plugins/platforms/blackberry/qbbwindow.cpp @@ -126,7 +126,7 @@ QBBWindow::QBBWindow(QWidget *window, screen_context_t context, QBBScreen *scree // Qt somtimes doesn't call these setters after creating the window, so we need to do that // ourselves here - if (window->parentWidget()) + if (window->parentWidget() && window->parentWidget()->platformWindow()) setParent(window->parentWidget()->platformWindow()); setGeometry(window->geometry()); setVisible(window->isVisible()); |