forked from qt-creator/qt-creator
QmlDesigner: Support builtins qmltypes
Task-number: QDS-6094 Change-Id: I1c3084b911b2918a9d185321dceb5ac409a8d438 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user