blob: 0091d77d6c652e48c0a35425ccb34db08ac41a7c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#pragma once
#include "buildsystem/qmlbuildsystem.h" // IWYU pragma: keep
#include "qmlprojectmanager_global.h"
#include <projectexplorer/project.h>
#include <QPointer>
namespace QmlProjectManager {
class QmlProject;
class QMLPROJECTMANAGER_EXPORT QmlProject : public ProjectExplorer::Project
{
Q_OBJECT
public:
explicit QmlProject(const Utils::FilePath &filename);
static bool isQtDesignStudioStartedFromQtC();
bool isEditModePreferred() const override;
ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const final;
static bool isMCUs();
protected:
RestoreResult fromMap(const Utils::Store &map, QString *errorMessage) override;
private:
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);
};
class FilesUpdateBlocker
{
public:
FilesUpdateBlocker(QmlBuildSystem *bs)
: m_bs(bs)
{
if (m_bs)
m_bs->m_blockFilesUpdate = true;
}
~FilesUpdateBlocker()
{
if (m_bs) {
m_bs->m_blockFilesUpdate = false;
m_bs->refresh(QmlBuildSystem::RefreshOptions::Project);
}
}
private:
QPointer<QmlBuildSystem> m_bs;
};
} // namespace QmlProjectManager
|