summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2023-03-02 10:31:02 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-02 17:03:19 +0000
commit71c281b9e8b3ff86407ba8aef2f9c11ed45ce6b2 (patch)
tree83cb4e462d0b50333eb5fb94af7152939d6b50b9
parentac23f4036527ed860b8fb5e9362b40be32128088 (diff)
downloadqtdeclarative-71c281b9e8b3ff86407ba8aef2f9c11ed45ce6b2.tar.gz
QQmlEngine: Improve import path method documentation
Instead of (partially) repeating the defaults listed in "QML Import Path", link to that section. Moreover, warn that setImportPath doesn't preserve the default paths. Task-number: QTBUG-109799 Change-Id: I6c2acb6efd1bd0984b3b540a75c7bced44127050 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 2d8b15cc1c71f0720f55f681732a608700696319) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qml/qml/qqmlengine.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 7c218276c2..285da1a4e4 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -1545,7 +1545,7 @@ void QQmlEnginePrivate::cleanupScarceResources()
The newly added \a path will be first in the importPathList().
- \sa setImportPathList(), {QML Modules}
+ \sa setImportPathList(), {QML Modules}, {QML Import Path}
*/
void QQmlEngine::addImportPath(const QString& path)
{
@@ -1563,9 +1563,8 @@ void QQmlEngine::addImportPath(const QString& path)
provided by that module. A \c qmldir file is required for defining the
type version mapping and possibly QML extensions plugins.
- By default, the list contains the directory of the application executable,
- paths specified in the \c QML_IMPORT_PATH environment variable,
- and the builtin \c QmlImportsPath from QLibraryInfo.
+ By default, this list contains the paths mentioned in
+ \l {QML Import Path}.
\sa addImportPath(), setImportPathList()
*/
@@ -1579,9 +1578,11 @@ QStringList QQmlEngine::importPathList() const
Sets \a paths as the list of directories where the engine searches for
installed modules in a URL-based directory structure.
- By default, the list contains the directory of the application executable,
- paths specified in the \c QML_IMPORT_PATH environment variable,
- and the builtin \c QmlImportsPath from QLibraryInfo.
+ By default, this list contains the paths mentioned in
+ \l {QML Import Path}.
+
+ \warning Calling setImportPathList does not preserve the default
+ import paths.
\sa importPathList(), addImportPath()
*/