summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRoger Maclean <rmaclean@qnx.com>2014-01-15 14:29:27 -0500
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-18 04:39:25 +0100
commit30e677e2bb21f45bbb3bc538d6c02f20dbbdfb11 (patch)
tree9b25cea1c0fe6bb6d1500e878ac01b8e127605bf /src
parent5fcee880975c0ee9e373b097209882fbd30add0b (diff)
QNX: Allow creation of parentless child windows
There is no reason why a parentless window from a Qt perspective needs to be a screen application window. There are some cases, such as the BB10 dialog service whose windows are always parented by a window in another process. Ideally one would have a means to indicate a child window was wanted that had no other side effect (i.e. the rest of Qt would ignore). The use of Qt::Dialog is not ideal as some code does pay attention to this type given the number of bits available for window type, it is not reasonable to add a new one. The use of Qt::Dialog seems safe since it is hard to conceive of a window of type Qt::Dialog wanting to be a top level window. If in future it is required to have a parentless, child window that is not of type Qt::Dialog one can simply define some additional way of signalling this. Change-Id: Ie7035980ac2efd5bc722a8371c834f21ea7755f4 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index e782db75eb..e28e5f40e5 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -86,9 +86,18 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, bool needRootW
QQnxScreen *platformScreen = static_cast<QQnxScreen *>(window->screen()->handle());
- m_isTopLevel = ( needRootWindow && !platformScreen->rootWindow())
- || (!needRootWindow && !parent())
- || window->type() == Qt::CoverWindow;
+ if (window->type() == Qt::CoverWindow) {
+ // Cover windows have to be top level to be accessible to window delegate (i.e. navigator)
+ m_isTopLevel = true;
+ } else if (parent() || (window->type() & Qt::Dialog) == Qt::Dialog) {
+ // If we have a parent we are a child window. Sometimes we have to be a child even if we
+ // don't have a parent e.g. our parent might be in a different process.
+ m_isTopLevel = false;
+ } else {
+ // We're parentless. If we're not using a root window, we'll always be a top-level window
+ // otherwise only the first window is.
+ m_isTopLevel = !needRootWindow || !platformScreen->rootWindow();
+ }
errno = 0;
if (m_isTopLevel) {