summaryrefslogtreecommitdiff
path: root/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2020-10-02 10:47:07 +0200
committerEike Ziller <eike.ziller@qt.io>2020-10-02 10:47:07 +0200
commit8b031c8c05d68d5154cdbc88b2035c5033c5a0a7 (patch)
tree15da073be7c3bdddecd7cf20ecba327a32bb80a4 /src/libs/qmljs/qmljsmodelmanagerinterface.cpp
parent528b634e5a0809060ed598ca2f5dd0a5b93c4128 (diff)
parentb6b6482c72748b42f2ca0993826d3ff859dc64eb (diff)
downloadqt-creator-8b031c8c05d68d5154cdbc88b2035c5033c5a0a7.tar.gz
Merge remote-tracking branch 'origin/4.13' into master
Change-Id: I3f2a6c553819e992da7e9f538dc44b95b482359e
Diffstat (limited to 'src/libs/qmljs/qmljsmodelmanagerinterface.cpp')
-rw-r--r--src/libs/qmljs/qmljsmodelmanagerinterface.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
index 519405aa4c..3cc8db7e63 100644
--- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
+++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
@@ -129,6 +129,7 @@ ModelManagerInterface::ModelManagerInterface(QObject *parent)
m_defaultProjectInfo.qtQmlPath = QFileInfo(
QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath)).canonicalFilePath();
+ m_defaultProjectInfo.qtVersionString = QLibraryInfo::version().toString();
updateImportPaths();
@@ -607,8 +608,10 @@ ModelManagerInterface::ProjectInfo ModelManagerInterface::projectInfoForPath(
ProjectInfo res;
const auto allProjectInfos = allProjectInfosForPath(path);
for (const ProjectInfo &pInfo : allProjectInfos) {
- if (res.qtQmlPath.isEmpty())
+ if (res.qtQmlPath.isEmpty()) {
res.qtQmlPath = pInfo.qtQmlPath;
+ res.qtVersionString = pInfo.qtVersionString;
+ }
res.applicationDirectories.append(pInfo.applicationDirectories);
for (const auto &importPath : pInfo.importPaths)
res.importPaths.maybeInsert(importPath);
@@ -1429,8 +1432,10 @@ ViewerContext ModelManagerInterface::getVContext(const ViewerContext &vCtx,
info = projectInfoForPath(doc->fileName());
ViewerContext defaultVCtx = defaultVContext(res.language, Document::Ptr(nullptr), false);
ProjectInfo defaultInfo = defaultProjectInfo();
- if (info.qtQmlPath.isEmpty())
+ if (info.qtQmlPath.isEmpty()) {
info.qtQmlPath = defaultInfo.qtQmlPath;
+ info.qtVersionString = defaultInfo.qtVersionString;
+ }
info.applicationDirectories = Utils::filteredUnique(info.applicationDirectories
+ defaultInfo.applicationDirectories);
switch (res.flags) {