-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
34 lines (27 loc) · 1.02 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
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include<Controllers/system.h>
#include<QQmlContext>
#include<Controllers/hvachandler.h>
#include<Controllers/audiocontroller.h>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
System m_systemHandler;
HVACHandler m_driverHVACHandler;
HVACHandler m_passengerHVACHandler;
AudioController m_audioController;
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("systemHandler",&m_systemHandler);
engine.rootContext()->setContextProperty("driverHVAC",&m_driverHVACHandler);
engine.rootContext()->setContextProperty("passengerHVAC",&m_passengerHVACHandler);
engine.rootContext()->setContextProperty("audioController",&m_audioController);
QObject::connect(
&engine,
&QQmlApplicationEngine::objectCreationFailed,
&app,
[]() { QCoreApplication::exit(-1); },
Qt::QueuedConnection);
engine.loadFromModule("TeslaInfotainment", "Main");
return app.exec();
}