summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto.qnx@kdab.com>2012-10-01 18:23:22 -0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-02 10:43:03 +0200
commit2884acf635825929204ae1c470b80df304de2d67 (patch)
tree6b74265bcf1c27f60422937abfc806b300fb6dc9 /src
parent1c2d3a8ddca1455525508601e9a024a180b1be64 (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). cherry-picked from qt5 04d296d64118ba2d647668494872d93cc1ef7ed1 Change-Id: I9304c5c9e64dca012a1903de7c80c168a701a5ea Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/blackberry/qbbwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/blackberry/qbbwindow.cpp b/src/plugins/platforms/blackberry/qbbwindow.cpp
index 07a2f913da..5d6a1c1124 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());