From faaa8b221965d3ffb7c520b94bcb96c818b171a7 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 8 Jan 2016 15:40:59 +0100 Subject: Enable using the module in a statically built application Change-Id: Ib3e11b80d0287bb0421d399d01b92c6367b52a1e Reviewed-by: Simon Hausmann Reviewed-by: Alex Blasche --- src/imports/bluetooth/bluetooth.pro | 5 +++++ src/imports/bluetooth/plugin.cpp | 8 ++++++++ src/imports/nfc/nfc.pro | 5 +++++ src/imports/nfc/plugin.cpp | 8 ++++++++ 4 files changed, 26 insertions(+) diff --git a/src/imports/bluetooth/bluetooth.pro b/src/imports/bluetooth/bluetooth.pro index 243322b5..f0df8eb9 100644 --- a/src/imports/bluetooth/bluetooth.pro +++ b/src/imports/bluetooth/bluetooth.pro @@ -1,3 +1,8 @@ +CXX_MODULE = connectivity +TARGET = declarative_bluetooth +TARGETPATH = QtBluetooth +IMPORT_VERSION = 5.6 + QT = core quick bluetooth HEADERS += \ diff --git a/src/imports/bluetooth/plugin.cpp b/src/imports/bluetooth/plugin.cpp index cb9d564f..79986da1 100644 --- a/src/imports/bluetooth/plugin.cpp +++ b/src/imports/bluetooth/plugin.cpp @@ -39,6 +39,13 @@ #include "qdeclarativebluetoothservice_p.h" #include "qdeclarativebluetoothsocket_p.h" +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_QtBluetooth); +#endif +} + QT_USE_NAMESPACE class QBluetoothQmlPlugin : public QQmlExtensionPlugin @@ -46,6 +53,7 @@ class QBluetoothQmlPlugin : public QQmlExtensionPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: + QBluetoothQmlPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } void registerTypes(const char *uri) { // @uri QtBluetooth diff --git a/src/imports/nfc/nfc.pro b/src/imports/nfc/nfc.pro index a020f09b..e2ec1b9e 100644 --- a/src/imports/nfc/nfc.pro +++ b/src/imports/nfc/nfc.pro @@ -1,3 +1,8 @@ +CXX_MODULE = connectivity +TARGET = declarative_nfc +TARGETPATH = QtNfc +IMPORT_VERSION = 5.6 + QT = core qml nfc # Input diff --git a/src/imports/nfc/plugin.cpp b/src/imports/nfc/plugin.cpp index ff7474f3..bfcc9aff 100644 --- a/src/imports/nfc/plugin.cpp +++ b/src/imports/nfc/plugin.cpp @@ -41,6 +41,13 @@ #include "qdeclarativendefurirecord_p.h" #include "qdeclarativendefmimerecord_p.h" +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_QtNfc); +#endif +} + QT_USE_NAMESPACE class QNfcQmlPlugin : public QQmlExtensionPlugin @@ -49,6 +56,7 @@ class QNfcQmlPlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: + QNfcQmlPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); } void registerTypes(const char *uri) { Q_ASSERT(uri == QStringLiteral("QtNfc")); -- cgit v1.2.3