diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-05-31 10:38:07 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-06-23 09:35:57 +0200 |
commit | 6aad465f080e4b0c5f7d1b0944bdd864e19d5783 (patch) | |
tree | 25a069579edd571e5ed7ebb7e9342b217fa4cc54 /src/qml/doc/src/cmake/qt_add_qml_module.qdoc | |
parent | 6a0ab2e8aa0bcc2487ae895033b493a9e4d7704b (diff) |
Introduce a sane resource path to qt_add_qml_module
Since "/qt" is reserved, we can use "/qt/qml" as the default path for
user QML modules.
[ChangeLog][QtQml] The AUTO_RESOURCE_PREFIX option was added to
qt_add_qml_module(). It places your QML modules in the otherwise
reserved resource directory /qt/qml. This directory is also added to the
default QML import path. By using it you don't have to specify custom
import paths anymore. Specifying neither AUTO_RESOURCE_PREFIX nor an
explicit RESOURCE_PREFIX will generate a warning now because such QML
modules are likely invisible in the resource file system.
Fixes: QTBUG-95145
Fixes: QTBUG-103452
Change-Id: Ie27dec5cbf34ea06258d55c659d202cdd61e54b2
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/qml/doc/src/cmake/qt_add_qml_module.qdoc')
-rw-r--r-- | src/qml/doc/src/cmake/qt_add_qml_module.qdoc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qml/doc/src/cmake/qt_add_qml_module.qdoc b/src/qml/doc/src/cmake/qt_add_qml_module.qdoc index 8b3fdb29f8..375daa0b94 100644 --- a/src/qml/doc/src/cmake/qt_add_qml_module.qdoc +++ b/src/qml/doc/src/cmake/qt_add_qml_module.qdoc @@ -23,6 +23,7 @@ qt_add_qml_module( [STATIC | SHARED] [PLUGIN_TARGET plugin_target] [OUTPUT_DIRECTORY output_dir] + [AUTO_RESOURCE_PREFIX] [RESOURCE_PREFIX resource_prefix] [CLASS_NAME class_name] [TYPEINFO typeinfo] @@ -200,6 +201,13 @@ The resource path of each file is determined by its path relative to the current source directory (\c CMAKE_CURRENT_SOURCE_DIR). This resource path is appended to a prefix formed by concatenating the \l{RESOURCE_PREFIX} and the target path (but see \l NO_RESOURCE_TARGET_PATH for an exception to this). + +Since Qt 6.4, you can specify \l{AUTO_RESOURCE_PREFIX}. If +\l{AUTO_RESOURCE_PREFIX} is specified, \l{RESOURCE_PREFIX} is set to +\c{/qt/qml}. This way, your modules are automatically +placed in the default import path of the QML engine. If you don't do this, you +should set up a \l{QML Import Path} to point to your resource prefix. + Ordinarily, the project should aim to place \c{.qml} files in the same relative location as they would have in the resources. If the \c{.qml} file is in a different relative directory to its desired resource path, its |