-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (29 loc) · 993 Bytes
/
main.cpp
File metadata and controls
35 lines (29 loc) · 993 Bytes
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
#include <QGuiApplication>
#include <qqml.h>
#include <QQmlApplicationEngine>
#include <QQuickStyle>
#include "vehicledata1.h"
#include "indicatorcontroller1.h"
#include "vehiclesimulator1.h"
int main(int argc, char *argv[])
{
// Uncomment env var to scale down app runtime size
qputenv("QT_SCALE_FACTOR", "0.5");
QGuiApplication app(argc, argv);
QQuickStyle::setStyle("Basic");
qmlRegisterSingletonType<IndicatorController>(
"Dashord", 1, 0, "IndicatorController",
[](QQmlEngine *engine, QJSEngine *scriptEngine)-> QObject*{
Q_UNUSED(scriptEngine)
return new IndicatorController(engine);
});
QQmlApplicationEngine engine;
QObject::connect(
&engine,
&QQmlApplicationEngine::objectCreationFailed,
&app,
[]() { QCoreApplication::exit(-1); },
Qt::QueuedConnection);
engine.loadFromModule("Dashboard", "Main");
return app.exec();
}