aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmljstools/qmljsmodelmanager.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-10-22 16:29:40 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-10-31 09:07:57 +0000
commit1e587831d14268e37f039bd1bf74e2ea2879967d (patch)
treea0e4c6b0f9ac33d88a4565dcb2a86ae60ca75d10 /src/plugins/qmljstools/qmljsmodelmanager.cpp
parent7a4cf827d931eb47bae30a1fd30c5598f888d033 (diff)
QmlJS: Scan app.qmltypes and lib.qmltypes for type information
app.qmltypes is being added as a new convention to Qt 5.15. These files are to be found next to application binaries, and contain the QML types those application register themselves, in contrast to QML types registered from plugins loaded via the regular import mechanism. lib.qmltypes works the same way, in principle, for libraries. This change only adds it to the possible names for qmltypes files, though. Change-Id: I1d7c5835c8c3e988d214c5cdb949ca677b48dfc5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/qmljstools/qmljsmodelmanager.cpp')
-rw-r--r--src/plugins/qmljstools/qmljsmodelmanager.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp
index fcc73d6f775..e5b90145439 100644
--- a/src/plugins/qmljstools/qmljsmodelmanager.cpp
+++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp
@@ -41,6 +41,7 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectnodes.h>
#include <projectexplorer/projecttree.h>
+#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
#include <qmljs/qmljsbind.h>
@@ -139,6 +140,13 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
// plugins that are not installed in default Qt qml installation directory.
projectInfo.qmlDumpEnvironment.appendOrSet("QML2_IMPORT_PATH", bc->environment().expandedValueForKey("QML2_IMPORT_PATH"), ":");
}
+
+ const auto appTargets = activeTarget->applicationTargets();
+ for (const auto &target : appTargets) {
+ if (target.targetFilePath.isEmpty())
+ continue;
+ projectInfo.applicationDirectories.append(target.targetFilePath.parentDir().toString());
+ }
}
if (!setPreferDump && qtVersion)
preferDebugDump = (qtVersion->defaultBuildConfig() & QtSupport::BaseQtVersion::DebugBuild);