【问题标题】:How to joing window group on QNX using QT platform native interface?如何使用QT平台原生界面加入QNX上的窗口组?
【发布时间】:2014-12-02 04:43:37
【问题描述】:

在 QQuickItem 中,我得到的窗口组名称如下:

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

我现在正试图弄清楚如何加入那个窗口组。如果有任何文档,则很少 QT平台原生界面。我通过谷歌搜索发现以下内容: 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);

所以我的问题是,在这种情况下,什么是“组”,是否有人可以显示使用此界面截取的代码?

感谢您的回复!

【问题讨论】:

  • 请问您打算如何使用它?无论如何,创建的新窗口都将加入父窗口。如果您想将此窗口加入其他窗口 - 只需更改父窗口即可。

标签: c++ qt qt5 qnx


【解决方案1】:

这个sn-p的代码是正确的,在QNX你可以加入不同进程创建的窗口的窗口组。在这种情况下,组是 QVariant()

这是元示例:

#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"));
......

请试一试,希望对您有所帮助,但老实说,我自己没有更改来测试它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-14
    • 1970-01-01
    • 2017-01-07
    • 1970-01-01
    • 2018-12-23
    • 1970-01-01
    相关资源
    最近更新 更多