From c23f23a739efa7ea6a7eea3f140383aa0329509f Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Fri, 27 Apr 2018 14:23:54 -0400 Subject: 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 Reviewed-by: Dan Cape --- src/plugins/platforms/qnx/qqnxwindow.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/qnx') 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()) { + Q_SCREEN_CHECKERROR( + screen_create_window_type(&m_window, m_screenContext, type.value()), + "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 id = windowId.toByteArray(); Q_SCREEN_CHECKERROR(screen_set_window_property_cv(m_window, SCREEN_PROPERTY_ID_STRING, -- cgit v1.2.3