summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>2012-10-01 15:28:04 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-02 10:42:06 +0200
commit7b2c8378cfa48f1dad2bd86136e33095bb13b664 (patch)
tree8fd06182a21203b39b2ae4e06bd8f2601ff20021 /src
parenta6717650711b107c96caf757f3aa91190a8bb52e (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. This is a backport of qtbase commit 4c33efc3228d82a82e13fe8c196b8c74a4998572 Change-Id: I5970cd2b2e0d58ef01dd99c10748195220d0e006 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/blackberry/qbbwindow.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/plugins/platforms/blackberry/qbbwindow.cpp b/src/plugins/platforms/blackberry/qbbwindow.cpp
index ff6653432f..07a2f913da 100644
--- a/src/plugins/platforms/blackberry/qbbwindow.cpp
+++ b/src/plugins/platforms/blackberry/qbbwindow.cpp
@@ -518,10 +518,9 @@ void QBBWindow::raise()
qDebug() << "QBBWindow::raise - w=" << widget();
#endif
- QBBWindow* oldParent = mParent;
- if (oldParent) {
- removeFromParent();
- oldParent->mChildren.push_back(this);
+ if (mParent) {
+ mParent->mChildren.removeAll(this);
+ mParent->mChildren.push_back(this);
} else {
mScreen->raiseWindow(this);
}
@@ -535,10 +534,9 @@ void QBBWindow::lower()
qDebug() << "QBBWindow::lower - w=" << widget();
#endif
- QBBWindow* oldParent = mParent;
- if (oldParent) {
- removeFromParent();
- oldParent->mChildren.push_front(this);
+ if (mParent) {
+ mParent->mChildren.removeAll(this);
+ mParent->mChildren.push_front(this);
} else {
mScreen->lowerWindow(this);
}