summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx/qqnxwindow.cpp
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire@kdab.com>2012-03-29 15:23:57 +0200
committerQt by Nokia <qt-info@nokia.com>2012-03-30 21:51:14 +0200
commitb5f343b3677a7c7f09d91d7d60f310717325e840 (patch)
tree9c2bf3b9858f88ad3d2b7943686a75566c6fc9c2 /src/plugins/platforms/qnx/qqnxwindow.cpp
parent5d7f7e6559bb78795c0572a605c2e635d28ec017 (diff)
Remove static methods in QQnxScreen
Change-Id: If0fd910848ba70d3b0a2d948065b09337f8e51c3 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxwindow.cpp')
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp39
1 files changed, 29 insertions, 10 deletions
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index e0fff0cd6a..66eb1cf777 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -124,7 +124,7 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context)
setScreen(static_cast<QQnxScreen *>(window->screen()->handle()));
// Add the window to the root of the hierarchy
- QQnxScreen::addWindow(this);
+ m_screen->addWindow(this);
// Add window to plugin's window mapper
QQnxIntegration::addWindow(m_window, window);
@@ -140,7 +140,7 @@ QQnxWindow::~QQnxWindow()
// Remove from parent's Hierarchy.
removeFromParent();
- QQnxScreen::updateHierarchy();
+ m_screen->updateHierarchy();
// We shouldn't allow this case unless QT allows it. Does it? Or should we send the
// handleCloseEvent on all children when this window is deleted?
@@ -415,6 +415,11 @@ void QQnxWindow::setScreen(QQnxScreen *platformScreen)
if (m_screen == platformScreen)
return;
+ if (m_screen && m_screen->findWindow(m_window)) {
+ m_screen->removeWindow(this);
+ platformScreen->addWindow(this);
+ }
+
m_screen = platformScreen;
// Move window to proper screen/display
@@ -440,7 +445,7 @@ void QQnxWindow::setScreen(QQnxScreen *platformScreen)
(*it)->setScreen(platformScreen);
}
- QQnxScreen::updateHierarchy();
+ m_screen->updateHierarchy();
}
void QQnxWindow::removeFromParent()
@@ -455,7 +460,7 @@ void QQnxWindow::removeFromParent()
else
qFatal("QQnxWindow: Window Hierarchy broken; window has parent, but parent hasn't got child.");
} else {
- QQnxScreen::removeWindow(this);
+ m_screen->removeWindow(this);
}
}
@@ -483,10 +488,10 @@ void QQnxWindow::setParent(const QPlatformWindow *window)
m_parentWindow->m_childWindows.push_back(this);
} else {
- QQnxScreen::addWindow(this);
+ m_screen->addWindow(this);
}
- QQnxScreen::updateHierarchy();
+ m_screen->updateHierarchy();
}
void QQnxWindow::raise()
@@ -500,10 +505,10 @@ void QQnxWindow::raise()
removeFromParent();
oldParent->m_childWindows.push_back(this);
} else {
- QQnxScreen::raiseWindow(this);
+ m_screen->raiseWindow(this);
}
- QQnxScreen::updateHierarchy();
+ m_screen->updateHierarchy();
}
void QQnxWindow::lower()
@@ -517,10 +522,10 @@ void QQnxWindow::lower()
removeFromParent();
oldParent->m_childWindows.push_front(this);
} else {
- QQnxScreen::lowerWindow(this);
+ m_screen->lowerWindow(this);
}
- QQnxScreen::updateHierarchy();
+ m_screen->updateHierarchy();
}
void QQnxWindow::requestActivateWindow()
@@ -552,6 +557,20 @@ void QQnxWindow::setPlatformOpenGLContext(QQnxGLContext *platformOpenGLContext)
m_platformOpenGLContext = platformOpenGLContext;
}
+QQnxWindow *QQnxWindow::findWindow(screen_window_t windowHandle)
+{
+ if (m_window == windowHandle)
+ return this;
+
+ Q_FOREACH (QQnxWindow *window, m_childWindows) {
+ QQnxWindow * const result = window->findWindow(windowHandle);
+ if (result)
+ return result;
+ }
+
+ return 0;
+}
+
void QQnxWindow::updateZorder(int &topZorder)
{
errno = 0;