How to joing window group on QNX using QT platform native interface?

473 views Asked by At

In QQuickItem I got window group name as follows:

QPlatformNativeInterface* interface = QCoreApplication::instance()->platformNativeInterface();
char* groupName = (char*) interface->nativeResourceForWindow( "windowGroup", window() );

I am now trying to figure out how to join that window group. There is very little if any documentation on QT platform native interface. I found following via google search: https://qt.gitorious.org/qt/qtbase/source/b08cc0ec6f096d0e6764486c81264c24a406bee1:src/plugins/platforms/qnx/qqnxwindow.cpp

At any point following the creation of the QQnxWindow object, an application can
change the window group it has joined. This is done by using the \e
setWindowProperty function of the native interface to set the \e qnxWindowGroup property
to the desired value, for example:

\code
QQuickView *view = new QQuickView(parent);
view->create();
QGuiApplication::platformNativeInterface()->setWindowProperty(view->handle(), "qnxWindowGroup",
                                                              group);

So my question is what is "group" in this case and if someone can show a code snipped using this interface ?

Thank you for your replies!

1

There are 1 answers

0
xchg.ca On

This snippet of code it correct, in QNX you can join window group of the window created by different process. group in this is case is QVariant()

Here is meta example:

#include <QGuiApplication>
#include "QtGui/5.3.1/QtGui/qpa/qplatformnativeinterface.h"
......
QQuickView *view = new QQuickView(parent);
view->create();
QGuiApplication::platformNativeInterface()->setWindowProperty(view->handle(), "qnxWindowGroup",QVariant("MyGroup"));
......

Please give a try, hope it helps, but honestly I did not have change to test it myself.