QmlDesigner: Disable exports not supported for MCU

Add helper function getStartupBuildSystem() to avoid code duplication.

Task-number: QDS-11544
Change-Id: Id8d752d63171838ac9ea6402ff9f2b179d0d8f53
Reviewed-by: Aleksei German <aleksei.german@qt.io>
This commit is contained in:
Thomas Hartmann
2024-02-01 15:52:48 +01:00
parent df0125547d
commit b894ae3d16
5 changed files with 34 additions and 19 deletions

View File

@@ -32,6 +32,7 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include "projectexplorer/projectmanager.h"
#include "projectitem/qmlprojectitem.h"
#include "projectnode/qmlprojectnodes.h"
@@ -389,6 +390,16 @@ Utils::FilePath QmlBuildSystem::getStartupQmlFileWithFallback() const
return {};
}
QmlBuildSystem *QmlBuildSystem::getStartupBuildSystem()
{
auto project = ProjectExplorer::ProjectManager::startupProject();
if (project && project->activeTarget() && project->activeTarget()->buildSystem()) {
return qobject_cast<QmlProjectManager::QmlBuildSystem *>(
project->activeTarget()->buildSystem());
}
return nullptr;
}
Utils::FilePath QmlBuildSystem::mainFilePath() const
{
const QString fileName = mainFile();