diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2023-03-02 10:31:02 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-03-02 17:24:32 +0000 |
commit | 5340581f9f0759308318658dcfe15157614adb04 (patch) | |
tree | 2c227f5dec4d37a4a7810c6a4bf7d1fe8303f029 /src | |
parent | 03984861278d4a23a3d7609feb1aebdaec1b609a (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmlengine.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index 77eab9eca3..0f79b005db 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -1769,7 +1769,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) { @@ -1787,9 +1787,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() */ @@ -1803,9 +1802,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() */ |