summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx/qqnxwindow.cpp
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto.qnx@kdab.com>2012-09-27 19:10:37 -0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-09-28 23:50:10 +0200
commit4c33efc3228d82a82e13fe8c196b8c74a4998572 (patch)
tree9a25eb71b728ab5c5dbddf69252aad78b7ececd7 /src/plugins/platforms/qnx/qqnxwindow.cpp
parentac9be327f8dc788a964b77c6bcdf0391c85c9cbd (diff)
QNX: fix bug on window hierarchy list
removeFromParent() must not be called from raise()/lower(), because it wrongly sets m_currentParent to 0, causing the parent/child link to be broken after a call either of these methods. Change-Id: I58f847dc4a46f2cf120cb3acf230bac46bcf24f5 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxwindow.cpp')
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index a3abac994b..42bc5b6164 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -547,10 +547,9 @@ void QQnxWindow::raise()
{
qWindowDebug() << Q_FUNC_INFO << "window =" << window();
- QQnxWindow *oldParent = m_parentWindow;
- if (oldParent) {
- removeFromParent();
- oldParent->m_childWindows.push_back(this);
+ if (m_parentWindow) {
+ m_parentWindow->m_childWindows.removeAll(this);
+ m_parentWindow->m_childWindows.push_back(this);
} else {
m_screen->raiseWindow(this);
}
@@ -562,10 +561,9 @@ void QQnxWindow::lower()
{
qWindowDebug() << Q_FUNC_INFO << "window =" << window();
- QQnxWindow *oldParent = m_parentWindow;
- if (oldParent) {
- removeFromParent();
- oldParent->m_childWindows.push_front(this);
+ if (m_parentWindow) {
+ m_parentWindow->m_childWindows.removeAll(this);
+ m_parentWindow->m_childWindows.push_front(this);
} else {
m_screen->lowerWindow(this);
}