summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames McDonnell <jmcdonnell@blackberry.com>2018-04-27 14:23:54 -0400
committerJames McDonnell <jmcdonnell@blackberry.com>2018-06-05 19:35:47 +0000
commitc23f23a739efa7ea6a7eea3f140383aa0329509f (patch)
tree42d6ae7cd53174486ad07a96c3eafcedd833c87e
parent59df474e13b28efdfff2495e1d1abe6724d97c71 (diff)
Add support for _q_platform_qnxWindowType QWindow property
This dynamic property can be used to specify an explicit QNX window type for a QNX platform window. The _q_platform_ prefix makes it possible to place the property on QWidget objects instead. Existing functionality ensures that any QWidget property whose name begins with _q_platform_ is copied to the underlying QWindow object prior to creation of the platform window. Add _q_platform_ aliases for the dynamic qnxInitialWindowGroup and qnxWindowId properties so that these properties can be also be specified on QWidget objects. Change-Id: Ia37a965dd25de333307b2bb5ae81446db271af1f Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Dan Cape <dcape@qnx.com>
-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 4a547aa158..fd46f624a9 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -174,7 +174,9 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, bool needRootW
// If a qnxInitialWindowGroup property is set on the window we'll take this as an
// indication that we want to create a child window and join that window group.
- const QVariant windowGroup = window->property("qnxInitialWindowGroup");
+ QVariant windowGroup = window->property("qnxInitialWindowGroup");
+ if (!windowGroup.isValid())
+ windowGroup = window->property("_q_platform_qnxParentGroup");
if (window->type() == Qt::CoverWindow) {
// Cover windows have to be top level to be accessible to window delegate (i.e. navigator)
@@ -194,7 +196,12 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, bool needRootW
if (window->type() == Qt::Desktop) // A desktop widget does not need a libscreen window
return;
- if (m_isTopLevel) {
+ QVariant type = window->property("_q_platform_qnxWindowType");
+ if (type.isValid() && type.canConvert<int>()) {
+ Q_SCREEN_CHECKERROR(
+ screen_create_window_type(&m_window, m_screenContext, type.value<int>()),
+ "Could not create window");
+ } else if (m_isTopLevel) {
Q_SCREEN_CRITICALERROR(screen_create_window(&m_window, m_screenContext),
"Could not create top level window"); // Creates an application window
if (window->type() != Qt::CoverWindow) {
@@ -212,7 +219,9 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, bool needRootW
// If the window has a qnxWindowId property, set this as the string id property. This generally
// needs to be done prior to joining any group as it might be used by the owner of the
// group to identify the window.
- const QVariant windowId = window->property("qnxWindowId");
+ QVariant windowId = window->property("qnxWindowId");
+ if (!windowId.isValid())
+ windowId = window->property("_q_platform_qnxWindowId");
if (windowId.isValid() && windowId.canConvert<QByteArray>()) {
QByteArray id = windowId.toByteArray();
Q_SCREEN_CHECKERROR(screen_set_window_property_cv(m_window, SCREEN_PROPERTY_ID_STRING,