summaryrefslogtreecommitdiffstats
path: root/examples/sensors/sensor_explorer/import
diff options
context:
space:
mode:
Diffstat (limited to 'examples/sensors/sensor_explorer/import')
-rw-r--r--examples/sensors/sensor_explorer/import/import.pro32
-rw-r--r--examples/sensors/sensor_explorer/import/main.cpp3
2 files changed, 26 insertions, 9 deletions
diff --git a/examples/sensors/sensor_explorer/import/import.pro b/examples/sensors/sensor_explorer/import/import.pro
index 85f471c6..196c373c 100644
--- a/examples/sensors/sensor_explorer/import/import.pro
+++ b/examples/sensors/sensor_explorer/import/import.pro
@@ -2,21 +2,39 @@ TEMPLATE = lib
CONFIG += plugin
TARGET = $$qtLibraryTarget(declarative_explorer)
-TARGETPATH = Explorer
+DESTDIR = ../Explorer
QT += qml sensors
-SOURCES = main.cpp explorer.cpp sensoritem.cpp propertyinfo.cpp
-HEADERS = explorer.h sensoritem.h propertyinfo.h
+SOURCES = \
+ main.cpp \
+ explorer.cpp \
+ sensoritem.cpp \
+ propertyinfo.cpp
-DESTPATH=$$[QT_INSTALL_EXAMPLES]/qtsensors/sensor_explorer/Explorer
+HEADERS = \
+ explorer.h \
+ sensoritem.h \
+ propertyinfo.h
-target.path=$$DESTPATH
-INSTALLS += target
+DESTPATH=$$[QT_INSTALL_EXAMPLES]/sensors/sensor_explorer/Explorer
+target.path=$$DESTPATH
qmldir.files=$$PWD/qmldir
qmldir.path=$$DESTPATH
-INSTALLS += qmldir
+INSTALLS += target qmldir
OTHER_FILES += \
plugin.json qmldir
+
+copyfile = $$PWD/qmldir
+copydest = $$DESTDIR
+
+# On Windows, use backslashes as directory separators
+win32: {
+ copyfile ~= s,/,\\,g
+ copydest ~= s,/,\\,g
+}
+
+# Copy the qmldir file to the same folder as the plugin binary
+QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$copyfile) $$quote($$copydest) $$escape_expand(\\n\\t)
diff --git a/examples/sensors/sensor_explorer/import/main.cpp b/examples/sensors/sensor_explorer/import/main.cpp
index f040fa16..36025e09 100644
--- a/examples/sensors/sensor_explorer/import/main.cpp
+++ b/examples/sensors/sensor_explorer/import/main.cpp
@@ -52,9 +52,8 @@ class SensorExplorerDeclarativeModule : public QQmlExtensionPlugin
public:
virtual void registerTypes(const char *uri)
{
- qDebug() << "SensorExplorerDeclarativeModule::registerTypes(const char *uri)";
-
Q_ASSERT(QLatin1String(uri) == QLatin1String("Explorer"));
+ // @uri Explorer
qmlRegisterType<QSensorExplorer>(uri, 1, 0, "SensorExplorer");
qmlRegisterType<QSensorItem>(uri, 1, 0, "SensorItem");
qmlRegisterType<QPropertyInfo>(uri, 1, 0, "PropertyInfo");