From 71c281b9e8b3ff86407ba8aef2f9c11ed45ce6b2 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Thu, 2 Mar 2023 10:31:02 +0100 Subject: 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 (cherry picked from commit 2d8b15cc1c71f0720f55f681732a608700696319) Reviewed-by: Qt Cherry-pick Bot --- src/qml/qml/qqmlengine.cpp | 15 ++++++++------- 1 file 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() */ -- cgit v1.2.3