QmlDesigner: Support builtins qmltypes

Task-number: QDS-6094
Change-Id: I1c3084b911b2918a9d185321dceb5ac409a8d438
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Marco Bubke
2022-02-15 15:10:30 +01:00
parent 4317c52a09
commit bd8e0796c2

View File

@@ -196,7 +196,7 @@ void QmlDesignerProjectManager::editorsClosed(const QList<::Core::IEditor *> &)
namespace {
QtSupport::BaseQtVersion *getBaseQtVersion(::ProjectExplorer::Target *target)
QtSupport::QtVersion *getQtVersion(::ProjectExplorer::Target *target)
{
if (target)
return QtSupport::QtKitAspect::qtVersion(target->kit());
@@ -204,9 +204,9 @@ QtSupport::BaseQtVersion *getBaseQtVersion(::ProjectExplorer::Target *target)
return {};
}
QtSupport::BaseQtVersion *getBaseQtVersion(::ProjectExplorer::Project *project)
QtSupport::QtVersion *getQtVersion(::ProjectExplorer::Project *project)
{
return getBaseQtVersion(project->activeTarget());
return getQtVersion(project->activeTarget());
}
Utils::FilePath qmlPath(::ProjectExplorer::Target *target)
@@ -262,6 +262,22 @@ QStringList qmlDirs(::ProjectExplorer::Target *target)
return qmldirPaths;
}
QStringList qmlTypes(::ProjectExplorer::Target *target)
{
if (!target)
return {};
QStringList qmldirPaths;
qmldirPaths.reserve(2);
const QString installDirectory = qmlPath(target).toString();
qmldirPaths.append(installDirectory + "/builtins.qmltypes");
qmldirPaths.append(installDirectory + "/jsroot.qmltypes");
return qmldirPaths;
}
} // namespace
void QmlDesignerProjectManager::projectAdded(::ProjectExplorer::Project *project)