summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/sensors/grue/import/import.pro6
-rw-r--r--examples/sensors/grue/import/main.cpp14
-rw-r--r--examples/sensors/grue/lib/lib.pro10
-rw-r--r--examples/sensors/grue/plugin/plugin.pro6
-rw-r--r--examples/sensors/grue/qml_app/main.qml1
5 files changed, 37 insertions, 0 deletions
diff --git a/examples/sensors/grue/import/import.pro b/examples/sensors/grue/import/import.pro
index 34027c7..1f74fa3 100644
--- a/examples/sensors/grue/import/import.pro
+++ b/examples/sensors/grue/import/import.pro
@@ -25,3 +25,9 @@ INSTALLS += qmldir
OTHER_FILES += \
plugin.json qmldir
+
+!isEmpty(EXAMPLES_PREFIX) {
+ QMAKE_LFLAGS += -Wl,-rpath,$$EXAMPLES_PREFIX/com.nokia.mt.grue/lib
+ DEFINES += "BUNDLED_PLUGIN=\\\"$$EXAMPLES_PREFIX/com.nokia.mt.grue/plugins\\\""
+}
+
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 <gruesensor.h>
+#ifdef BUNDLED_PLUGIN
+#include <QFile>
+#include <QCoreApplication>
+#include <QQmlEngine>
+#include <QStringList>
+#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";
diff --git a/examples/sensors/grue/lib/lib.pro b/examples/sensors/grue/lib/lib.pro
index 7e087ba..e048e60 100644
--- a/examples/sensors/grue/lib/lib.pro
+++ b/examples/sensors/grue/lib/lib.pro
@@ -15,3 +15,13 @@ SOURCES += gruesensor.cpp\
target.path=$$[QT_INSTALL_LIBS]
INSTALLS += target
+MT_SYSROOT=$$(MT_SYSROOT)
+!isEmpty(MT_SYSROOT):EXAMPLES_PREFIX=/opt/mt/applications
+!isEmpty(EXAMPLES_PREFIX) {
+ target.path = $$EXAMPLES_PREFIX/com.nokia.mt.grue/lib
+ remove_so.commands = "rm $(INSTALL_ROOT)$${target.path}/lib$${TARGET}.so"
+ remove_so.CONFIG = no_path
+ remove_so.depends = install_target
+ INSTALLS += remove_so
+}
+
diff --git a/examples/sensors/grue/plugin/plugin.pro b/examples/sensors/grue/plugin/plugin.pro
index 489a1ce..32e127f 100644
--- a/examples/sensors/grue/plugin/plugin.pro
+++ b/examples/sensors/grue/plugin/plugin.pro
@@ -19,3 +19,9 @@ INSTALLS += target
OTHER_FILES += \
plugin.json
+MT_SYSROOT=$$(MT_SYSROOT)
+!isEmpty(MT_SYSROOT):EXAMPLES_PREFIX=/opt/mt/applications
+!isEmpty(EXAMPLES_PREFIX) {
+ target.path = $$EXAMPLES_PREFIX/com.nokia.mt.grue/plugins/sensors
+}
+
diff --git a/examples/sensors/grue/qml_app/main.qml b/examples/sensors/grue/qml_app/main.qml
index 5b619c6..05d267c 100644
--- a/examples/sensors/grue/qml_app/main.qml
+++ b/examples/sensors/grue/qml_app/main.qml
@@ -76,6 +76,7 @@ Rectangle {
Text {
id: text
anchors.top: parent.top
+ anchors.topMargin: 20
anchors.left: parent.left
anchors.right: parent.right
text: "I can't tell if you're going to be eaten by a Grue or not. You're on your own!"