2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2023-02-13 00:49:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2009-05-04 12:19:22 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2009-05-04 12:19:22 +02:00
|
|
|
|
2023-02-13 00:49:09 +01:00
|
|
|
#include "buildsystem/qmlbuildsystem.h" // IWYU pragma: keep
|
2010-01-12 16:56:36 +01:00
|
|
|
#include "qmlprojectmanager_global.h"
|
2009-05-04 12:19:22 +02:00
|
|
|
#include <projectexplorer/project.h>
|
|
|
|
|
|
2010-02-16 13:39:13 +01:00
|
|
|
namespace QmlProjectManager {
|
2009-12-16 16:39:39 +01:00
|
|
|
|
2019-10-22 14:55:51 +02:00
|
|
|
class QmlProject;
|
2009-12-16 16:39:39 +01:00
|
|
|
|
2023-02-13 00:49:09 +01:00
|
|
|
class QMLPROJECTMANAGER_EXPORT QmlProject : public ProjectExplorer::Project
|
2019-10-22 14:55:51 +02:00
|
|
|
{
|
2010-01-12 16:56:36 +01:00
|
|
|
Q_OBJECT
|
2019-10-22 14:55:51 +02:00
|
|
|
public:
|
2023-02-13 00:49:09 +01:00
|
|
|
explicit QmlProject(const Utils::FilePath &filename);
|
|
|
|
|
|
|
|
|
|
static bool isQtDesignStudioStartedFromQtC();
|
|
|
|
|
bool isEditModePreferred() const override;
|
|
|
|
|
|
|
|
|
|
ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const final;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override;
|
2022-06-13 13:23:12 +02:00
|
|
|
|
2020-03-03 12:30:28 +01:00
|
|
|
private:
|
2023-02-13 00:49:09 +01:00
|
|
|
ProjectExplorer::DeploymentKnowledge deploymentKnowledge() const override;
|
|
|
|
|
Utils::FilePaths collectUiQmlFilesForFolder(const Utils::FilePath &folder) const;
|
|
|
|
|
Utils::FilePaths collectQmlFiles() const;
|
|
|
|
|
|
|
|
|
|
bool setKitWithVersion(const int qtMajorVersion, const QList<ProjectExplorer::Kit *> kits);
|
|
|
|
|
|
|
|
|
|
bool allowOnlySingleProject();
|
|
|
|
|
int preferedQtTarget(ProjectExplorer::Target *target);
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void parsingFinished(const ProjectExplorer::Target *target, bool success);
|
2020-03-03 12:30:28 +01:00
|
|
|
};
|
|
|
|
|
|
2023-02-13 00:49:09 +01:00
|
|
|
class FilesUpdateBlocker
|
|
|
|
|
{
|
2020-03-03 12:30:28 +01:00
|
|
|
public:
|
2023-02-13 00:49:09 +01:00
|
|
|
FilesUpdateBlocker(QmlBuildSystem *bs)
|
|
|
|
|
: m_bs(bs)
|
|
|
|
|
{
|
2020-03-03 12:30:28 +01:00
|
|
|
if (m_bs)
|
|
|
|
|
m_bs->m_blockFilesUpdate = true;
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-13 00:49:09 +01:00
|
|
|
~FilesUpdateBlocker()
|
|
|
|
|
{
|
2020-03-03 12:30:28 +01:00
|
|
|
if (m_bs) {
|
|
|
|
|
m_bs->m_blockFilesUpdate = false;
|
2023-02-13 00:49:09 +01:00
|
|
|
m_bs->refresh(QmlBuildSystem::RefreshOptions::Project);
|
2020-03-03 12:30:28 +01:00
|
|
|
}
|
|
|
|
|
}
|
2019-10-25 09:55:32 +02:00
|
|
|
|
|
|
|
|
private:
|
2023-02-13 00:49:09 +01:00
|
|
|
QPointer<QmlBuildSystem> m_bs;
|
2019-10-25 09:55:32 +02:00
|
|
|
};
|
|
|
|
|
|
2009-05-04 12:19:22 +02:00
|
|
|
} // namespace QmlProjectManager
|