summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMyoungSeok Song <misong@blackberry.com>2013-08-29 13:53:59 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-12 19:43:33 +0200
commitfddf76f2ac12f219b99a8b877844a473cce27542 (patch)
treeada4fd82dd48d8d3a6d1a372293d7007501ce3b4
parente30bad8b244f935d8a025f94f7d20ee495bc43e1 (diff)
QNX: add nativeResourceForScreen
Implemented nativeResourceForScreen api to return QObject* which can be used to connect foreignWindowCreated, foreignWindowClosed signal in QQnxScreen. Usecase is to connect signal in custom QML component as below QObject * obs = interface->nativeResourceForScreen("QObject*", screen); connect(obs, SIGNAL(foreignWindowCreated(void*)), d, SLOT(newForeignWindowCreated(void*))); Change-Id: I512c3b6d188a2e90ef7b8e89c413ca420a29dd9b Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
-rw-r--r--src/plugins/platforms/qnx/qqnxnativeinterface.cpp8
-rw-r--r--src/plugins/platforms/qnx/qqnxnativeinterface.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/platforms/qnx/qqnxnativeinterface.cpp b/src/plugins/platforms/qnx/qqnxnativeinterface.cpp
index e147ca72e5..4dd3444832 100644
--- a/src/plugins/platforms/qnx/qqnxnativeinterface.cpp
+++ b/src/plugins/platforms/qnx/qqnxnativeinterface.cpp
@@ -62,4 +62,12 @@ void *QQnxNativeInterface::nativeResourceForWindow(const QByteArray &resource, Q
return 0;
}
+void *QQnxNativeInterface::nativeResourceForScreen(const QByteArray &resource, QScreen *screen)
+{
+ if (resource == "QObject*" && screen)
+ return static_cast<QObject*>(static_cast<QQnxScreen*>(screen->handle()));
+
+ return 0;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qqnxnativeinterface.h b/src/plugins/platforms/qnx/qqnxnativeinterface.h
index d84df205e5..6692da2576 100644
--- a/src/plugins/platforms/qnx/qqnxnativeinterface.h
+++ b/src/plugins/platforms/qnx/qqnxnativeinterface.h
@@ -50,6 +50,7 @@ class QQnxNativeInterface : public QPlatformNativeInterface
{
public:
void *nativeResourceForWindow(const QByteArray &resource, QWindow *window);
+ void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen);
};
QT_END_NAMESPACE