main.cpp Example File
heartrate-game/main.cpp
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QtCore/QLoggingCategory>
#include "connectionhandler.h"
#include "devicefinder.h"
#include "devicehandler.h"
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
ConnectionHandler connectionHandler;
DeviceHandler deviceHandler;
DeviceFinder deviceFinder(&deviceHandler);
qmlRegisterUncreatableType<DeviceHandler>("Shared", 1, 0, "AddressType", "Enum is not a type");
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("connectionHandler", &connectionHandler);
engine.rootContext()->setContextProperty("deviceFinder", &deviceFinder);
engine.rootContext()->setContextProperty("deviceHandler", &deviceHandler);
engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
return app.exec();
}