2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-02-16 13:39:13 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2010-02-16 13:39:13 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-02-16 13:39:13 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2010-02-16 13:39:13 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-02-16 13:39:13 +01:00
|
|
|
|
2010-07-13 15:02:37 +02:00
|
|
|
#include "qmlprojectrunconfiguration.h"
|
2010-02-16 13:39:13 +01:00
|
|
|
#include "qmlproject.h"
|
|
|
|
|
#include "qmlprojectmanagerconstants.h"
|
2020-01-06 14:48:51 +01:00
|
|
|
#include "qmlmainfileaspect.h"
|
2020-06-18 08:49:29 +02:00
|
|
|
#include "qmlmultilanguageaspect.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
|
|
|
|
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>
|
2020-01-06 14:48:51 +01:00
|
|
|
#include <projectexplorer/runconfigurationaspects.h>
|
2021-08-03 18:33:38 +02:00
|
|
|
#include <projectexplorer/runcontrol.h>
|
|
|
|
|
#include <projectexplorer/session.h>
|
2012-04-24 15:49:09 +02:00
|
|
|
#include <projectexplorer/target.h>
|
2018-09-07 08:27:44 +02: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
|
|
|
|
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>
|
2015-02-04 09:32:46 +01:00
|
|
|
#include <utils/mimetypes/mimedatabase.h>
|
2013-10-23 22:07:46 +03:00
|
|
|
#include <utils/qtcprocess.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
|
|
|
|
2010-02-16 13:39:13 +01:00
|
|
|
namespace QmlProjectManager {
|
2020-06-18 08:49:29 +02:00
|
|
|
class QmlMultiLanguageAspect;
|
2020-02-11 11:18:18 +01:00
|
|
|
namespace 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
|
|
|
|
2021-08-03 18:33:38 +02:00
|
|
|
static bool isQtDesignStudio()
|
|
|
|
|
{
|
|
|
|
|
QSettings *settings = Core::ICore::settings();
|
|
|
|
|
const QString qdsStandaloneEntry = "QML/Designer/StandAloneMode"; //entry from qml settings
|
|
|
|
|
|
|
|
|
|
return settings->value(qdsStandaloneEntry, false).toBool();
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-11 11:18:18 +01:00
|
|
|
class QmlProjectRunConfiguration final : public RunConfiguration
|
|
|
|
|
{
|
|
|
|
|
Q_DECLARE_TR_FUNCTIONS(QmlProjectManager::QmlProjectRunConfiguration)
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
QString mainScript() const;
|
2021-07-13 09:41:26 +02:00
|
|
|
FilePath qmlRuntimeFilePath() const;
|
2020-02-11 11:18:18 +01:00
|
|
|
QString commandLineArguments() const;
|
2021-08-03 18:33:38 +02:00
|
|
|
void createQtVersionAspect();
|
2020-02-11 11:18:18 +01:00
|
|
|
|
2020-08-13 09:16:00 +02:00
|
|
|
StringAspect *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;
|
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
|
|
|
{
|
2020-08-13 09:16:00 +02:00
|
|
|
m_qmlViewerAspect = addAspect<StringAspect>();
|
2018-10-19 15:58:40 +02:00
|
|
|
m_qmlViewerAspect->setLabelText(tr("QML Viewer:"));
|
2019-06-11 14:39:39 +02:00
|
|
|
m_qmlViewerAspect->setPlaceHolderText(commandLine().executable().toString());
|
2020-08-13 09:16:00 +02:00
|
|
|
m_qmlViewerAspect->setDisplayStyle(StringAspect::LineEditDisplay);
|
2019-04-08 13:43:26 +02:00
|
|
|
m_qmlViewerAspect->setHistoryCompleter("QmlProjectManager.viewer.history");
|
2018-09-03 09:41:07 +02:00
|
|
|
|
2018-09-07 08:27:44 +02:00
|
|
|
auto argumentAspect = addAspect<ArgumentsAspect>();
|
|
|
|
|
argumentAspect->setSettingsKey(Constants::QML_VIEWER_ARGUMENTS_KEY);
|
2013-11-01 14:13:41 +01:00
|
|
|
|
2019-06-11 14:39:39 +02:00
|
|
|
setCommandLineGetter([this] {
|
2021-07-13 09:41:26 +02:00
|
|
|
return CommandLine(qmlRuntimeFilePath(), commandLineArguments(), CommandLine::Raw);
|
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);
|
|
|
|
|
|
|
|
|
|
auto envAspect = addAspect<EnvironmentAspect>();
|
|
|
|
|
connect(m_multiLanguageAspect, &QmlMultiLanguageAspect::changed, envAspect, &EnvironmentAspect::environmentChanged);
|
|
|
|
|
|
|
|
|
|
auto envModifier = [this](Environment env) {
|
|
|
|
|
if (auto bs = dynamic_cast<const QmlBuildSystem *>(activeBuildSystem()))
|
|
|
|
|
env.modify(bs->environment());
|
|
|
|
|
|
|
|
|
|
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) {
|
|
|
|
|
envAspect->addPreferredBaseEnvironment(tr("System Environment"), [envModifier] {
|
|
|
|
|
return envModifier(Environment::systemEnvironment());
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
envAspect->addSupportedBaseEnvironment(tr("Clean Environment"), [envModifier] {
|
|
|
|
|
Environment environment;
|
|
|
|
|
return envModifier(environment);
|
|
|
|
|
});
|
|
|
|
|
|
2021-04-13 12:44:42 +02:00
|
|
|
setRunnableModifier([this](Runnable &r) {
|
|
|
|
|
const QmlBuildSystem *bs = static_cast<QmlBuildSystem *>(activeBuildSystem());
|
|
|
|
|
r.workingDirectory = bs->targetDirectory().toString();
|
|
|
|
|
});
|
|
|
|
|
|
2021-07-12 10:38:13 +02:00
|
|
|
setDisplayName(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())
|
|
|
|
|
return 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()) {
|
2021-07-12 10:38:13 +02:00
|
|
|
return tr("No QML utility found.");
|
2017-11-28 15:57:15 +01:00
|
|
|
}
|
2019-11-15 17:32:29 +01:00
|
|
|
if (viewer.isEmpty())
|
2021-07-12 10:38:13 +02:00
|
|
|
return 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
|
|
|
{
|
2018-09-03 09:41:07 +02:00
|
|
|
const QString qmlViewer = m_qmlViewerAspect->value();
|
|
|
|
|
if (!qmlViewer.isEmpty())
|
2019-11-15 17:32:29 +01:00
|
|
|
return FilePath::fromString(qmlViewer);
|
2018-09-03 09:41:07 +02:00
|
|
|
|
2019-11-15 17:32:29 +01:00
|
|
|
Kit *kit = target()->kit();
|
|
|
|
|
BaseQtVersion *version = QtKitAspect::qtVersion(kit);
|
2021-07-12 10:38:13 +02:00
|
|
|
if (!version) // No Qt version in Kit. Don't try to run QML runtime.
|
2019-11-15 17:32:29 +01:00
|
|
|
return {};
|
2017-11-28 15:57:15 +01:00
|
|
|
|
2019-11-15 17:32:29 +01:00
|
|
|
const Id deviceType = DeviceTypeKitAspect::deviceTypeId(kit);
|
2017-11-28 15:57:15 +01:00
|
|
|
if (deviceType == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
|
|
|
|
|
// If not given explicitly by Qt Version, try to pick it from $PATH.
|
2019-11-15 17:32:29 +01:00
|
|
|
const bool isDesktop = version->type() == QtSupport::Constants::DESKTOPQT;
|
2021-07-13 09:41:26 +02:00
|
|
|
return isDesktop ? version->qmlRuntimeFilePath() : FilePath::fromString("qmlscene");
|
2017-11-28 15:57:15 +01:00
|
|
|
}
|
|
|
|
|
|
2019-11-15 17:32:29 +01:00
|
|
|
IDevice::ConstPtr dev = DeviceKitAspect::device(kit);
|
2021-07-12 10:38:13 +02:00
|
|
|
if (dev.isNull()) // No device set. We don't know where a QML utility is.
|
2019-11-15 17:32:29 +01:00
|
|
|
return {};
|
2012-08-23 14:53:03 +02:00
|
|
|
|
2021-07-13 09:41:26 +02:00
|
|
|
const QString qmlRuntime = dev->qmlRunCommand();
|
2017-11-28 15:57:15 +01:00
|
|
|
// If not given explicitly by device, try to pick it from $PATH.
|
2021-07-13 09:41:26 +02:00
|
|
|
return FilePath::fromString(qmlRuntime.isEmpty() ? QString("qmlscene") : qmlRuntime);
|
2010-09-28 17:26:27 +02:00
|
|
|
}
|
|
|
|
|
|
2013-10-11 11:20:11 +02:00
|
|
|
QString QmlProjectRunConfiguration::commandLineArguments() const
|
2010-02-16 13:39:13 +01:00
|
|
|
{
|
|
|
|
|
// arguments in .user file
|
2018-09-07 13:29:45 +02:00
|
|
|
QString args = aspect<ArgumentsAspect>()->arguments(macroExpander());
|
2020-09-07 15:56:18 +02:00
|
|
|
const IDevice::ConstPtr device = DeviceKitAspect::device(kit());
|
2019-11-15 17:32:29 +01:00
|
|
|
const OsType osType = device ? device->osType() : HostOsInfo::hostOs();
|
2010-02-16 13:39:13 +01:00
|
|
|
|
|
|
|
|
// arguments from .qmlproject file
|
2019-12-16 16:19:44 +01:00
|
|
|
const QmlBuildSystem *bs = qobject_cast<QmlBuildSystem *>(target()->buildSystem());
|
2018-02-22 10:42:13 +01:00
|
|
|
foreach (const QString &importPath,
|
2019-10-25 09:55:32 +02:00
|
|
|
QmlBuildSystem::makeAbsolute(bs->targetDirectory(), bs->customImportPaths())) {
|
2021-05-06 13:07:36 +02:00
|
|
|
ProcessArgs::addArg(&args, "-I", osType);
|
|
|
|
|
ProcessArgs::addArg(&args, importPath, osType);
|
2010-02-16 13:39:13 +01:00
|
|
|
}
|
|
|
|
|
|
2019-10-25 09:55:32 +02:00
|
|
|
for (const QString &fileSelector : bs->customFileSelectors()) {
|
2021-05-06 13:07:36 +02:00
|
|
|
ProcessArgs::addArg(&args, "-S", osType);
|
|
|
|
|
ProcessArgs::addArg(&args, fileSelector, osType);
|
2019-04-08 17:02:20 +02:00
|
|
|
}
|
|
|
|
|
|
2021-05-06 13:07:36 +02:00
|
|
|
if (HostOsInfo::isWindowsHost() && bs->forceFreeType()) {
|
|
|
|
|
ProcessArgs::addArg(&args, "-platform", osType);
|
|
|
|
|
ProcessArgs::addArg(&args, "windows:fontengine=freetype", osType);
|
2019-12-04 13:10:38 +01:00
|
|
|
}
|
|
|
|
|
|
2019-10-25 09:55:32 +02:00
|
|
|
const QString main = bs->targetFile(FilePath::fromString(mainScript())).toString();
|
2017-11-28 15:57:15 +01:00
|
|
|
if (!main.isEmpty())
|
2021-05-06 13:07:36 +02:00
|
|
|
ProcessArgs::addArg(&args, main, osType);
|
2020-06-18 08:49:29 +02:00
|
|
|
|
|
|
|
|
if (m_multiLanguageAspect && m_multiLanguageAspect->value())
|
2021-05-06 13:07:36 +02:00
|
|
|
ProcessArgs::addArg(&args, "-qmljsdebugger=file:unused_if_debugger_arguments_added,services:DebugTranslation", osType);
|
2020-06-18 08:49:29 +02:00
|
|
|
|
2010-02-16 13:39:13 +01:00
|
|
|
return args;
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-03 18:33:38 +02:00
|
|
|
void QmlProjectRunConfiguration::createQtVersionAspect()
|
|
|
|
|
{
|
|
|
|
|
if (!isQtDesignStudio())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
m_qtversionAspect = addAspect<SelectionAspect>();
|
|
|
|
|
m_qtversionAspect->setDisplayStyle(SelectionAspect::DisplayStyle::ComboBox);
|
|
|
|
|
m_qtversionAspect->setLabelText(tr("Qt Version:"));
|
|
|
|
|
m_qtversionAspect->setSettingsKey("QmlProjectManager.kit");
|
|
|
|
|
|
|
|
|
|
Kit *kit = target()->kit();
|
|
|
|
|
BaseQtVersion *version = QtKitAspect::qtVersion(kit);
|
|
|
|
|
|
|
|
|
|
if (version) {
|
|
|
|
|
const QmlBuildSystem *buildSystem = qobject_cast<QmlBuildSystem *>(target()->buildSystem());
|
|
|
|
|
const bool isQt6Project = buildSystem && buildSystem->qt6Project();
|
|
|
|
|
|
|
|
|
|
if (isQt6Project) {
|
|
|
|
|
m_qtversionAspect->addOption(tr("Qt 6"));
|
|
|
|
|
m_qtversionAspect->setReadOnly(true);
|
|
|
|
|
} else { /* Only if this is not a Qt 6 project changing kits makes sense */
|
|
|
|
|
m_qtversionAspect->addOption(tr("Qt 5"));
|
|
|
|
|
m_qtversionAspect->addOption(tr("Qt 6"));
|
|
|
|
|
|
|
|
|
|
const int valueForVersion = version->qtVersion().majorVersion == 6 ? 1 : 0;
|
|
|
|
|
|
|
|
|
|
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) {
|
|
|
|
|
QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(k);
|
|
|
|
|
return (version && version->qtVersion().majorVersion == preferedQtVersion)
|
|
|
|
|
&& 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());
|
|
|
|
|
|
|
|
|
|
SessionManager::setActiveTarget(project, newTarget, SetActive::Cascade);
|
|
|
|
|
|
|
|
|
|
/* 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
|
|
|
}
|
|
|
|
|
|
2018-09-07 08:27:44 +02:00
|
|
|
QString QmlProjectRunConfiguration::mainScript() const
|
|
|
|
|
{
|
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()
|
2021-07-12 10:38:13 +02:00
|
|
|
: FixedRunConfigurationFactory(QmlProjectRunConfiguration::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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
2010-02-16 13:39:13 +01:00
|
|
|
} // namespace QmlProjectManager
|