-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
44 lines (31 loc) · 1.32 KB
/
main.cpp
File metadata and controls
44 lines (31 loc) · 1.32 KB
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
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <Qt3DQuick/QQmlAspectEngine>
#include <Qt3DQuickExtras/qt3dquickwindow.h>
#include <QQmlEngine>
#include "pectusviewer.h"
#include "pectusprocessor.h"
#include "pectuspdf.h"
#include <QDebug>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
PectusProcessor myProcessor;
PectusViewer myViewer;
PectusPDF myPDF(&myViewer, &myProcessor);
QQmlContext* context = engine.rootContext();
context->setContextProperty("myViewer", &myViewer);
qmlRegisterUncreatableType<PectusViewer>("PectusViewer", 1, 1, "PectusViewer", "Do not instantiate");
context->setContextProperty("myProcessor", &myProcessor);
qmlRegisterUncreatableType<PectusProcessor>("PectusProcessor", 1, 1, "PectusProcessor", "Do not instantiate");
context->setContextProperty("myPDF", &myPDF);
qmlRegisterUncreatableType<PectusPDF>("PectusPDF", 1, 1, "PectusPDF", "Do not instantiate");
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
myProcessor.setRootQmlObject(engine.rootObjects().first());
myPDF.setRootQmlObject(engine.rootObjects().first());
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}