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>
{
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);
}
{
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);
}