-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
52 lines (42 loc) · 1.62 KB
/
main.cpp
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
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QObject>
#include <QIcon>
#include <QQuickView>
#include <QtQuick>
#include <QDebug>
#include "src/Diagrams/UseCase/usecase.h"
#include "src/Diagrams/Class/classdiagram.h"
#include "src/Diagrams/Activity/activity.h"
#include "src/Diagrams/Component/component.h"
#include "src/Diagrams/Deployment/deployment.h"
#include "src/Diagrams/Sequense/sequence.h"
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
//! [icons]
QIcon::setThemeName(QStringLiteral("DiagramTool"));
//! [icons]
QQmlApplicationEngine engine;
UseCase m_useCase;
Activity m_activity;
ClassDiagram m_ClassDiagram;
Component m_Component;
Deployment m_Deployment;
Sequence m_Sequence;
auto root_context = engine.rootContext();
root_context->setContextProperty("UseCase", &m_useCase);
root_context->setContextProperty("Activity", &m_activity);
root_context->setContextProperty("ClassDiagram", &m_ClassDiagram);
root_context->setContextProperty("ComponentDiagram", &m_Component);
root_context->setContextProperty("Deployment", &m_Deployment);
root_context->setContextProperty("Sequence", &m_Sequence);
engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
if (engine.rootObjects().isEmpty())
{
return -1;
}
app.setWindowIcon(QIcon(":/icons/diagramTool.svg"));
return app.exec();
}