From da4cdfec983572148bd41dbacaacb318783e519c Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 15 Nov 2019 12:23:49 +0100 Subject: 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 --- examples/qml/qmlextensionplugins/plugins.qmlproject | 2 ++ .../qml/qmlextensionplugins/qmlextensionplugins.pro | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) (limited to 'examples/qml') 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 -- cgit v1.2.3