aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-11-15 12:23:49 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-01-14 09:44:15 +0100
commitda4cdfec983572148bd41dbacaacb318783e519c (patch)
tree84912e8f99d60241016d5f3fa5af4569cd738047 /examples/qml
parent3dc5b937c4e9acf83ee54e870390c22f341c29c8 (diff)
examples: Make qmlextensionplugins example usable without installation
The qmldir file as well as the .qml files have to be placed next to the plugin, the import path has to be added to the .qmlproject, we want the .qmltypes file added to the same place, and the plugins.qml should also be available in the destination directory. Change-Id: I82b369693e612779c6213345cc8f6a30b16d41b4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'examples/qml')
-rw-r--r--examples/qml/qmlextensionplugins/plugins.qmlproject2
-rw-r--r--examples/qml/qmlextensionplugins/qmlextensionplugins.pro21
2 files changed, 17 insertions, 6 deletions
diff --git a/examples/qml/qmlextensionplugins/plugins.qmlproject b/examples/qml/qmlextensionplugins/plugins.qmlproject
index 771ab45b66..c2de5f5703 100644
--- a/examples/qml/qmlextensionplugins/plugins.qmlproject
+++ b/examples/qml/qmlextensionplugins/plugins.qmlproject
@@ -13,4 +13,6 @@ Project {
ImageFiles {
directory: "."
}
+
+ importPaths: [ "imports" ]
}
diff --git a/examples/qml/qmlextensionplugins/qmlextensionplugins.pro b/examples/qml/qmlextensionplugins/qmlextensionplugins.pro
index 40c2b396a3..c074b8d671 100644
--- a/examples/qml/qmlextensionplugins/qmlextensionplugins.pro
+++ b/examples/qml/qmlextensionplugins/qmlextensionplugins.pro
@@ -7,6 +7,7 @@ QML_IMPORT_MAJOR_VERSION = 1
DESTDIR = imports/$$QML_IMPORT_NAME
TARGET = qmlqtimeexampleplugin
+QMLTYPES_FILENAME = $$DESTDIR/plugins.qmltypes
SOURCES += \
plugin.cpp \
@@ -23,14 +24,22 @@ PLUGINFILES = \
imports/$$QML_IMPORT_NAME/hour.png \
imports/$$QML_IMPORT_NAME/minute.png
-pluginfiles.files += $$PLUGINFILES
+target.path = $$[QT_INSTALL_EXAMPLES]/qml/qmlextensionplugins/imports/$$QML_IMPORT_NAME
-qml.files = plugins.qml
-qml.path += $$[QT_INSTALL_EXAMPLES]/qml/qmlextensionplugins
-target.path += $$[QT_INSTALL_EXAMPLES]/qml/qmlextensionplugins/imports/$$QML_IMPORT_NAME
-pluginfiles.path += $$[QT_INSTALL_EXAMPLES]/qml/qmlextensionplugins/imports/$$QML_IMPORT_NAME
+pluginfiles_copy.files = $$PLUGINFILES
+pluginfiles_copy.path = $$DESTDIR
-INSTALLS += target qml pluginfiles
+pluginfiles_install.files = $$PLUGINFILES $$OUT_PWD/$$DESTDIR/plugins.qmltypes
+pluginfiles_install.path = $$[QT_INSTALL_EXAMPLES]/qml/qmlextensionplugins/imports/$$QML_IMPORT_NAME
+
+qml_copy.files = plugins.qml plugins.qmlproject
+qml_copy.path = $$OUT_PWD
+
+qml_install.files = plugins.qml plugins.qmlproject
+qml_install.path = $$[QT_INSTALL_EXAMPLES]/qml/qmlextensionplugins
+
+INSTALLS += target qml_install pluginfiles_install
+COPIES += qml_copy pluginfiles_copy
OTHER_FILES += $$PLUGINFILES plugins.qml