From 8a36fce9f7f2db716327a611682a41c96e6d8472 Mon Sep 17 00:00:00 2001 From: Lincoln Ramsay Date: Fri, 13 Apr 2012 16:23:26 +1000 Subject: Package the grue sensor example into a self-contained bundle. Cleaner for deployment (no need to write to inaccessible system locations) though it uses a bit of a hack to get QtSensors to find the backend plugin. Change-Id: Ibfa765d928a2d57429832c68594bcbe38f9d6a6e Reviewed-by: Zsolt Simon --- examples/sensors/grue/import/main.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'examples/sensors/grue/import/main.cpp') diff --git a/examples/sensors/grue/import/main.cpp b/examples/sensors/grue/import/main.cpp index 4924bde..2e8583e 100644 --- a/examples/sensors/grue/import/main.cpp +++ b/examples/sensors/grue/import/main.cpp @@ -43,6 +43,13 @@ #include +#ifdef BUNDLED_PLUGIN +#include +#include +#include +#include +#endif + QT_BEGIN_NAMESPACE class GrueSensorQmlImport : public QQmlExtensionPlugin @@ -50,6 +57,13 @@ class GrueSensorQmlImport : public QQmlExtensionPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface" FILE "plugin.json") public: +#ifdef BUNDLED_PLUGIN + GrueSensorQmlImport() + { + QCoreApplication::addLibraryPath(QString::fromLocal8Bit(BUNDLED_PLUGIN)); + } +#endif + virtual void registerTypes(const char *uri) { char const * const package = "Grue"; -- cgit v1.2.1