2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2010-02-16 13:39:13 +01:00
|
|
|
|
2010-07-13 15:02:37 +02:00
|
|
|
#include "qmlprojectrunconfiguration.h"
|
2020-01-06 14:48:51 +01:00
|
|
|
#include "qmlmainfileaspect.h"
|
2020-06-18 08:49:29 +02:00
|
|
|
#include "qmlmultilanguageaspect.h"
|
2023-01-19 15:36:40 +01:00
|
|
|
#include "qmlproject.h"
|
|
|
|
|
#include "qmlprojectmanagerconstants.h"
|
|
|
|
|
#include "qmlprojectmanagertr.h"
|
2018-09-07 08:27:44 +02:00
|
|
|
|
2010-02-16 13:39:13 +01:00
|
|
|
#include <coreplugin/editormanager/editormanager.h>
|
|
|
|
|
#include <coreplugin/editormanager/ieditor.h>
|
|
|
|
|
#include <coreplugin/icore.h>
|
2015-02-26 13:38:54 +01:00
|
|
|
#include <coreplugin/idocument.h>
|
2018-09-07 08:27:44 +02:00
|
|
|
|
2022-04-12 21:01:45 +02:00
|
|
|
#include <projectexplorer/devicesupport/idevice.h>
|
2021-08-03 18:33:38 +02:00
|
|
|
#include <projectexplorer/environmentaspect.h>
|
2019-03-07 09:08:40 +01:00
|
|
|
#include <projectexplorer/kitinformation.h>
|
2021-08-03 18:33:38 +02:00
|
|
|
#include <projectexplorer/kitmanager.h>
|
2018-09-07 08:27:44 +02:00
|
|
|
#include <projectexplorer/projectexplorer.h>
|
2022-06-22 15:43:33 +02:00
|
|
|
#include <projectexplorer/projectexplorerconstants.h>
|
2020-01-06 14:48:51 +01:00
|
|
|
#include <projectexplorer/runconfigurationaspects.h>
|
2021-08-03 18:33:38 +02:00
|
|
|
#include <projectexplorer/runcontrol.h>
|
2023-02-14 15:47:22 +01:00
|
|
|
#include <projectexplorer/projectmanager.h>
|
2012-04-24 15:49:09 +02:00
|
|
|
#include <projectexplorer/target.h>
|
2018-09-07 08:27:44 +02:00
|
|
|
|
2023-02-07 15:30:51 +01:00
|
|
|
#include <qmldesignerbase/qmldesignerbaseplugin.h>
|
2023-03-26 15:58:49 +02:00
|
|
|
#include <qmldesignerbase/utils/qmlpuppetpaths.h>
|
2023-02-07 15:30:51 +01:00
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
#include <qtsupport/qtkitinformation.h>
|
2011-05-20 21:40:53 +02:00
|
|
|
#include <qtsupport/qtsupportconstants.h>
|
2010-11-29 09:45:30 +01:00
|
|
|
|
2022-05-17 14:59:01 +02:00
|
|
|
#include <utils/algorithm.h>
|
2020-09-18 12:11:40 +02:00
|
|
|
#include <utils/aspects.h>
|
2019-03-07 09:08:40 +01:00
|
|
|
#include <utils/environment.h>
|
2013-10-23 22:07:46 +03:00
|
|
|
#include <utils/fileutils.h>
|
2023-05-03 17:05:35 +02:00
|
|
|
#include <utils/process.h>
|
2011-01-05 14:44:52 +01:00
|
|
|
#include <utils/winutils.h>
|
2019-03-07 09:08:40 +01:00
|
|
|
|
2015-08-05 15:16:27 +02:00
|
|
|
#include <qmljstools/qmljstoolsconstants.h>
|
2010-12-21 12:39:14 +01:00
|
|
|
|
2013-08-30 16:38:57 +02:00
|
|
|
using namespace Core;
|
2014-05-26 22:13:14 +03:00
|
|
|
using namespace ProjectExplorer;
|
2017-12-20 19:11:10 +01:00
|
|
|
using namespace QtSupport;
|
2019-03-07 09:08:40 +01:00
|
|
|
using namespace Utils;
|
2017-12-20 19:11:10 +01:00
|
|
|
|
2022-12-13 10:48:30 +01:00
|
|
|
namespace QmlProjectManager::Internal {
|
2010-02-16 13:39:13 +01:00
|
|
|
|
2018-09-07 08:27:44 +02:00
|
|
|
// QmlProjectRunConfiguration
|
2010-11-29 09:45:30 +01:00
|
|
|
|
2020-02-11 11:18:18 +01:00
|
|
|
class QmlProjectRunConfiguration final : public RunConfiguration
|
|
|
|
|
{
|
|
|
|
|
public:
|
2021-04-13 12:44:42 +02:00
|
|
|
QmlProjectRunConfiguration(Target *target, Id id);
|
2020-02-11 11:18:18 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QString disabledReason() const final;
|
|
|
|
|
bool isEnabled() const final;
|
|
|
|
|
|
2023-01-06 09:47:53 +01:00
|
|
|
FilePath mainScript() const;
|
2021-07-13 09:41:26 +02:00
|
|
|
FilePath qmlRuntimeFilePath() const;
|
2021-08-03 18:33:38 +02:00
|
|
|
void createQtVersionAspect();
|
2020-02-11 11:18:18 +01:00
|
|
|
|
2023-06-01 09:54:03 +02:00
|
|
|
FilePathAspect *m_qmlViewerAspect = nullptr;
|
2020-02-11 11:18:18 +01:00
|
|
|
QmlMainFileAspect *m_qmlMainFileAspect = nullptr;
|
2020-06-18 08:49:29 +02:00
|
|
|
QmlMultiLanguageAspect *m_multiLanguageAspect = nullptr;
|
2021-08-03 18:33:38 +02:00
|
|
|
SelectionAspect *m_qtversionAspect = nullptr;
|
2023-01-23 22:58:50 +01:00
|
|
|
mutable bool usePuppetAsQmlRuntime = false;
|
2020-02-11 11:18:18 +01:00
|
|
|
};
|
|
|
|
|
|
2018-04-25 10:26:08 +02:00
|
|
|
QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id)
|
|
|
|
|
: RunConfiguration(target, id)
|
2010-02-16 13:39:13 +01:00
|
|
|
{
|
2023-06-01 09:54:03 +02:00
|
|
|
m_qmlViewerAspect = addAspect<FilePathAspect>();
|
2023-01-19 15:36:40 +01:00
|
|
|
m_qmlViewerAspect->setLabelText(Tr::tr("Override device QML viewer:"));
|
2023-01-12 14:05:09 +01:00
|
|
|
m_qmlViewerAspect->setPlaceHolderText(qmlRuntimeFilePath().toUserOutput());
|
2019-04-08 13:43:26 +02:00
|
|
|
m_qmlViewerAspect->setHistoryCompleter("QmlProjectManager.viewer.history");
|
2023-01-12 14:05:09 +01:00
|
|
|
m_qmlViewerAspect->setSettingsKey(Constants::QML_VIEWER_KEY);
|
2018-09-03 09:41:07 +02:00
|
|
|
|
2022-05-11 16:51:46 +02:00
|
|
|
auto argumentAspect = addAspect<ArgumentsAspect>(macroExpander());
|
2018-09-07 08:27:44 +02:00
|
|
|
argumentAspect->setSettingsKey(Constants::QML_VIEWER_ARGUMENTS_KEY);
|
2013-11-01 14:13:41 +01:00
|
|
|
|
2022-12-13 10:48:30 +01:00
|
|
|
setCommandLineGetter([this, target] {
|
|
|
|
|
const FilePath qmlRuntime = qmlRuntimeFilePath();
|
|
|
|
|
CommandLine cmd(qmlRuntime);
|
2023-03-26 15:58:49 +02:00
|
|
|
if (usePuppetAsQmlRuntime)
|
|
|
|
|
cmd.addArg("--qml-runtime");
|
2022-12-13 10:48:30 +01:00
|
|
|
|
|
|
|
|
// arguments in .user file
|
|
|
|
|
cmd.addArgs(aspect<ArgumentsAspect>()->arguments(), CommandLine::Raw);
|
|
|
|
|
|
|
|
|
|
// arguments from .qmlproject file
|
|
|
|
|
const QmlBuildSystem *bs = qobject_cast<QmlBuildSystem *>(target->buildSystem());
|
|
|
|
|
const QStringList importPaths = QmlBuildSystem::makeAbsolute(bs->targetDirectory(),
|
|
|
|
|
bs->customImportPaths());
|
|
|
|
|
for (const QString &importPath : importPaths) {
|
|
|
|
|
cmd.addArg("-I");
|
|
|
|
|
cmd.addArg(importPath);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (const QString &fileSelector : bs->customFileSelectors()) {
|
|
|
|
|
cmd.addArg("-S");
|
|
|
|
|
cmd.addArg(fileSelector);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (qmlRuntime.osType() == OsTypeWindows && bs->forceFreeType()) {
|
|
|
|
|
cmd.addArg("-platform");
|
|
|
|
|
cmd.addArg("windows:fontengine=freetype");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bs->qt6Project() && bs->widgetApp()) {
|
|
|
|
|
cmd.addArg("--apptype");
|
|
|
|
|
cmd.addArg("widget");
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-06 09:47:53 +01:00
|
|
|
const FilePath main = bs->targetFile(mainScript());
|
2022-12-13 10:48:30 +01:00
|
|
|
if (!main.isEmpty())
|
|
|
|
|
cmd.addArg(main.nativePath());
|
|
|
|
|
|
|
|
|
|
return cmd;
|
2019-06-11 14:39:39 +02:00
|
|
|
});
|
|
|
|
|
|
2020-01-06 14:48:51 +01:00
|
|
|
m_qmlMainFileAspect = addAspect<QmlMainFileAspect>(target);
|
|
|
|
|
connect(m_qmlMainFileAspect, &QmlMainFileAspect::changed, this, &RunConfiguration::update);
|
2018-09-07 08:27:44 +02:00
|
|
|
|
2021-08-03 18:33:38 +02:00
|
|
|
createQtVersionAspect();
|
|
|
|
|
|
2019-12-04 09:19:50 +01:00
|
|
|
connect(target, &Target::kitChanged, this, &RunConfiguration::update);
|
2017-09-01 13:23:02 +02:00
|
|
|
|
2020-06-18 08:49:29 +02:00
|
|
|
m_multiLanguageAspect = addAspect<QmlMultiLanguageAspect>(target);
|
2022-01-19 08:24:14 +02:00
|
|
|
auto buildSystem = qobject_cast<const QmlBuildSystem *>(activeBuildSystem());
|
|
|
|
|
if (buildSystem)
|
|
|
|
|
m_multiLanguageAspect->setValue(buildSystem->multilanguageSupport());
|
2020-06-18 08:49:29 +02:00
|
|
|
|
|
|
|
|
auto envAspect = addAspect<EnvironmentAspect>();
|
2022-01-19 08:24:14 +02:00
|
|
|
connect(m_multiLanguageAspect,
|
|
|
|
|
&QmlMultiLanguageAspect::changed,
|
|
|
|
|
envAspect,
|
|
|
|
|
&EnvironmentAspect::environmentChanged);
|
2020-06-18 08:49:29 +02:00
|
|
|
|
|
|
|
|
auto envModifier = [this](Environment env) {
|
2022-01-19 08:24:14 +02:00
|
|
|
if (auto bs = qobject_cast<const QmlBuildSystem *>(activeBuildSystem()))
|
2020-06-18 08:49:29 +02:00
|
|
|
env.modify(bs->environment());
|
|
|
|
|
|
2022-01-19 08:24:14 +02:00
|
|
|
if (m_multiLanguageAspect && m_multiLanguageAspect->value()
|
|
|
|
|
&& !m_multiLanguageAspect->databaseFilePath().isEmpty()) {
|
|
|
|
|
env.set("QT_MULTILANGUAGE_DATABASE",
|
|
|
|
|
m_multiLanguageAspect->databaseFilePath().toString());
|
2020-07-20 20:45:08 +02:00
|
|
|
env.set("QT_MULTILANGUAGE_LANGUAGE", m_multiLanguageAspect->currentLocale());
|
2020-07-20 10:28:16 +02:00
|
|
|
} else {
|
|
|
|
|
env.unset("QT_MULTILANGUAGE_DATABASE");
|
|
|
|
|
env.unset("QT_MULTILANGUAGE_LANGUAGE");
|
2020-06-18 08:49:29 +02:00
|
|
|
}
|
|
|
|
|
return env;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const Id deviceTypeId = DeviceTypeKitAspect::deviceTypeId(target->kit());
|
|
|
|
|
if (deviceTypeId == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
|
2023-01-19 15:36:40 +01:00
|
|
|
envAspect->addPreferredBaseEnvironment(Tr::tr("System Environment"), [envModifier] {
|
2020-06-18 08:49:29 +02:00
|
|
|
return envModifier(Environment::systemEnvironment());
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-19 15:36:40 +01:00
|
|
|
envAspect->addSupportedBaseEnvironment(Tr::tr("Clean Environment"), [envModifier] {
|
2020-06-18 08:49:29 +02:00
|
|
|
Environment environment;
|
|
|
|
|
return envModifier(environment);
|
|
|
|
|
});
|
|
|
|
|
|
2022-12-13 14:47:24 +01:00
|
|
|
if (HostOsInfo::isAnyUnixHost())
|
|
|
|
|
addAspect<X11ForwardingAspect>(macroExpander());
|
|
|
|
|
|
2021-04-13 12:44:42 +02:00
|
|
|
setRunnableModifier([this](Runnable &r) {
|
|
|
|
|
const QmlBuildSystem *bs = static_cast<QmlBuildSystem *>(activeBuildSystem());
|
2021-08-02 18:02:10 +02:00
|
|
|
r.workingDirectory = bs->targetDirectory();
|
2022-12-13 14:47:24 +01:00
|
|
|
if (const auto * const forwardingAspect = aspect<X11ForwardingAspect>())
|
|
|
|
|
r.extraData.insert("Ssh.X11ForwardToDisplay", forwardingAspect->display());
|
2021-04-13 12:44:42 +02:00
|
|
|
});
|
|
|
|
|
|
2023-01-19 15:36:40 +01:00
|
|
|
setDisplayName(Tr::tr("QML Utility", "QMLRunConfiguration display name."));
|
2019-12-04 09:19:50 +01:00
|
|
|
update();
|
2017-09-01 13:23:02 +02:00
|
|
|
}
|
|
|
|
|
|
2011-05-26 16:30:35 +02:00
|
|
|
QString QmlProjectRunConfiguration::disabledReason() const
|
|
|
|
|
{
|
2017-07-17 14:34:05 +02:00
|
|
|
if (mainScript().isEmpty())
|
2023-01-19 15:36:40 +01:00
|
|
|
return Tr::tr("No script file to execute.");
|
2019-11-15 17:32:29 +01:00
|
|
|
|
2021-07-13 09:41:26 +02:00
|
|
|
const FilePath viewer = qmlRuntimeFilePath();
|
2020-09-07 15:56:18 +02:00
|
|
|
if (DeviceTypeKitAspect::deviceTypeId(kit())
|
2017-11-28 15:57:15 +01:00
|
|
|
== ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE
|
2019-11-15 17:32:29 +01:00
|
|
|
&& !viewer.exists()) {
|
2023-01-19 15:36:40 +01:00
|
|
|
return Tr::tr("No QML utility found.");
|
2017-11-28 15:57:15 +01:00
|
|
|
}
|
2019-11-15 17:32:29 +01:00
|
|
|
if (viewer.isEmpty())
|
2023-01-19 15:36:40 +01:00
|
|
|
return Tr::tr("No QML utility specified for target device.");
|
2017-07-17 14:34:05 +02:00
|
|
|
return RunConfiguration::disabledReason();
|
2011-05-26 16:30:35 +02:00
|
|
|
}
|
|
|
|
|
|
2021-07-13 09:41:26 +02:00
|
|
|
FilePath QmlProjectRunConfiguration::qmlRuntimeFilePath() const
|
2010-09-28 17:26:27 +02:00
|
|
|
{
|
2023-01-23 22:58:50 +01:00
|
|
|
usePuppetAsQmlRuntime = false;
|
2022-12-13 14:47:24 +01:00
|
|
|
// Give precedence to the manual override in the run configuration.
|
2022-11-28 14:16:21 +01:00
|
|
|
const FilePath qmlViewer = m_qmlViewerAspect->filePath();
|
2018-09-03 09:41:07 +02:00
|
|
|
if (!qmlViewer.isEmpty())
|
2022-11-28 14:16:21 +01:00
|
|
|
return qmlViewer;
|
2018-09-03 09:41:07 +02:00
|
|
|
|
2019-11-15 17:32:29 +01:00
|
|
|
Kit *kit = target()->kit();
|
2022-12-16 12:37:19 +01:00
|
|
|
|
|
|
|
|
// We might not have a full Qt version for building, but the device
|
|
|
|
|
// might know what is good for running.
|
|
|
|
|
if (IDevice::ConstPtr dev = DeviceKitAspect::device(kit)) {
|
2022-12-14 17:01:10 +01:00
|
|
|
const FilePath qmlRuntime = dev->qmlRunCommand();
|
|
|
|
|
if (!qmlRuntime.isEmpty())
|
|
|
|
|
return qmlRuntime;
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-16 12:37:19 +01:00
|
|
|
// The Qt version might know. That's the "build" Qt version,
|
|
|
|
|
// i.e. not necessarily something the device can use, but the
|
|
|
|
|
// device had its chance above.
|
|
|
|
|
if (QtVersion *version = QtKitAspect::qtVersion(kit)) {
|
2023-02-08 13:28:53 +01:00
|
|
|
if (version->qtVersion().majorVersion() > 5) {
|
|
|
|
|
auto [workingDirectoryPath, puppetPath] = QmlDesigner::QmlPuppetPaths::qmlPuppetPaths(
|
|
|
|
|
target(), QmlDesigner::QmlDesignerBasePlugin::settings());
|
|
|
|
|
if (!puppetPath.isEmpty()) {
|
|
|
|
|
usePuppetAsQmlRuntime = true;
|
|
|
|
|
return puppetPath;
|
|
|
|
|
}
|
2023-01-23 22:58:50 +01:00
|
|
|
}
|
2022-12-16 12:37:19 +01:00
|
|
|
const FilePath qmlRuntime = version->qmlRuntimeFilePath();
|
|
|
|
|
if (!qmlRuntime.isEmpty())
|
|
|
|
|
return qmlRuntime;
|
2017-11-28 15:57:15 +01:00
|
|
|
}
|
|
|
|
|
|
2022-12-16 12:37:19 +01:00
|
|
|
// If not given explicitly by run device, nor Qt, try to pick
|
|
|
|
|
// it from $PATH on the run device.
|
|
|
|
|
return "qml";
|
2010-09-28 17:26:27 +02:00
|
|
|
}
|
|
|
|
|
|
2021-08-03 18:33:38 +02:00
|
|
|
void QmlProjectRunConfiguration::createQtVersionAspect()
|
|
|
|
|
{
|
2022-02-04 16:59:04 +01:00
|
|
|
if (!QmlProject::isQtDesignStudio())
|
2021-08-03 18:33:38 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
m_qtversionAspect = addAspect<SelectionAspect>();
|
|
|
|
|
m_qtversionAspect->setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox);
|
2023-01-19 15:36:40 +01:00
|
|
|
m_qtversionAspect->setLabelText(Tr::tr("Qt Version:"));
|
2021-08-03 18:33:38 +02:00
|
|
|
m_qtversionAspect->setSettingsKey("QmlProjectManager.kit");
|
|
|
|
|
|
|
|
|
|
Kit *kit = target()->kit();
|
2022-01-21 16:06:36 +01:00
|
|
|
QtVersion *version = QtKitAspect::qtVersion(kit);
|
2021-08-03 18:33:38 +02:00
|
|
|
|
|
|
|
|
if (version) {
|
|
|
|
|
const QmlBuildSystem *buildSystem = qobject_cast<QmlBuildSystem *>(target()->buildSystem());
|
|
|
|
|
const bool isQt6Project = buildSystem && buildSystem->qt6Project();
|
|
|
|
|
|
|
|
|
|
if (isQt6Project) {
|
2023-01-19 15:36:40 +01:00
|
|
|
m_qtversionAspect->addOption(Tr::tr("Qt 6"));
|
2021-08-03 18:33:38 +02:00
|
|
|
m_qtversionAspect->setReadOnly(true);
|
|
|
|
|
} else { /* Only if this is not a Qt 6 project changing kits makes sense */
|
2023-01-19 15:36:40 +01:00
|
|
|
m_qtversionAspect->addOption(Tr::tr("Qt 5"));
|
|
|
|
|
m_qtversionAspect->addOption(Tr::tr("Qt 6"));
|
2021-08-03 18:33:38 +02:00
|
|
|
|
2022-07-04 18:36:40 +02:00
|
|
|
const int valueForVersion = version->qtVersion().majorVersion() == 6 ? 1 : 0;
|
2021-08-03 18:33:38 +02:00
|
|
|
|
|
|
|
|
m_qtversionAspect->setValue(valueForVersion);
|
|
|
|
|
|
|
|
|
|
connect(m_qtversionAspect, &SelectionAspect::changed, this, [&]() {
|
|
|
|
|
QTC_ASSERT(target(), return );
|
|
|
|
|
auto project = target()->project();
|
|
|
|
|
QTC_ASSERT(project, return );
|
|
|
|
|
|
|
|
|
|
int oldValue = !m_qtversionAspect->value();
|
|
|
|
|
const int preferedQtVersion = m_qtversionAspect->value() > 0 ? 6 : 5;
|
|
|
|
|
Kit *currentKit = target()->kit();
|
|
|
|
|
|
|
|
|
|
const QList<Kit *> kits = Utils::filtered(KitManager::kits(), [&](const Kit *k) {
|
2022-01-21 16:06:36 +01:00
|
|
|
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(k);
|
2022-07-04 18:36:40 +02:00
|
|
|
return (version && version->qtVersion().majorVersion() == preferedQtVersion)
|
2021-08-03 18:33:38 +02:00
|
|
|
&& DeviceTypeKitAspect::deviceTypeId(k)
|
|
|
|
|
== ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (kits.contains(currentKit))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (!kits.isEmpty()) {
|
|
|
|
|
auto newTarget = target()->project()->target(kits.first());
|
|
|
|
|
if (!newTarget)
|
|
|
|
|
newTarget = project->addTargetForKit(kits.first());
|
|
|
|
|
|
2023-02-14 15:47:22 +01:00
|
|
|
project->setActiveTarget(newTarget, SetActive::Cascade);
|
2021-08-03 18:33:38 +02:00
|
|
|
|
|
|
|
|
/* Reset the aspect. We changed the target and this aspect should not change. */
|
|
|
|
|
m_qtversionAspect->blockSignals(true);
|
|
|
|
|
m_qtversionAspect->setValue(oldValue);
|
|
|
|
|
m_qtversionAspect->blockSignals(false);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-25 09:55:32 +02:00
|
|
|
bool QmlProjectRunConfiguration::isEnabled() const
|
2010-08-19 16:51:27 +02:00
|
|
|
{
|
2020-12-03 15:17:23 +01:00
|
|
|
return m_qmlMainFileAspect->isQmlFilePresent() && !commandLine().executable().isEmpty()
|
|
|
|
|
&& activeBuildSystem()->hasParsingData();
|
2010-08-19 16:51:27 +02:00
|
|
|
}
|
|
|
|
|
|
2023-01-06 09:47:53 +01:00
|
|
|
FilePath QmlProjectRunConfiguration::mainScript() const
|
2018-09-07 08:27:44 +02:00
|
|
|
{
|
2020-01-06 14:48:51 +01:00
|
|
|
return m_qmlMainFileAspect->mainScript();
|
2010-03-05 11:11:05 +01:00
|
|
|
}
|
|
|
|
|
|
2020-02-11 11:18:18 +01:00
|
|
|
// QmlProjectRunConfigurationFactory
|
2018-04-06 14:55:56 +02:00
|
|
|
|
|
|
|
|
QmlProjectRunConfigurationFactory::QmlProjectRunConfigurationFactory()
|
2023-01-19 15:36:40 +01:00
|
|
|
: FixedRunConfigurationFactory(Tr::tr("QML Runtime"), false)
|
2018-04-06 14:55:56 +02:00
|
|
|
{
|
2018-04-25 10:26:08 +02:00
|
|
|
registerRunConfiguration<QmlProjectRunConfiguration>
|
2021-07-12 10:38:13 +02:00
|
|
|
("QmlProjectManager.QmlRunConfiguration.Qml");
|
2018-04-06 14:55:56 +02:00
|
|
|
addSupportedProjectType(QmlProjectManager::Constants::QML_PROJECT_ID);
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-13 10:48:30 +01:00
|
|
|
} // QmlProjectManager::Internal
|