diff options
author | Fawzi Mohamed <fawzi.mohamed@qt.io> | 2020-09-29 09:55:41 +0200 |
---|---|---|
committer | Fawzi Mohamed <fawzi.mohamed@qt.io> | 2020-09-29 14:24:14 +0000 |
commit | 45716a4ccccfe3e48dc486c419fefac0be3c3173 (patch) | |
tree | bed4e30bdd3b692e3e340dbc8ab422a2cc6b7d44 /src | |
parent | 168c3df4c652c6dba58a635c90e93e4ec371d91c (diff) |
QmlJS: set and propagate qtVersion in ProjectInfo
Change-Id: Icbeb3679c8a76c111a5e3503b2c496c28c830342
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/qmljs/qmljsmodelmanagerinterface.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp index dc4c855c26..b2a6b4f575 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp @@ -130,6 +130,7 @@ ModelManagerInterface::ModelManagerInterface(QObject *parent) m_defaultProjectInfo.qtQmlPath = QFileInfo( QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath)).canonicalFilePath(); + m_defaultProjectInfo.qtVersionString = QLibraryInfo::version().toString(); updateImportPaths(); @@ -608,8 +609,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); @@ -1430,8 +1433,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) { |