LedDisplay/OmobiDisplayApp/main.cpp

27 lines
774 B
C++
Raw Normal View History

2020-10-08 20:06:57 +02:00
#include <QGuiApplication>
#include <QQmlApplicationEngine>
2020-10-09 00:03:50 +02:00
#include <qbluetoothleuart.h>
2020-10-08 20:06:57 +02:00
#include "omobidisplaybackend.h"
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
2020-10-09 00:03:50 +02:00
qmlRegisterType<OmobiDisplayBackend>("de.itsblue.omobidisplayapp", 1, 0, "OmobiDisplayBackend");
QBluetoothLeUart::init();
2020-10-08 20:06:57 +02:00
QQmlApplicationEngine engine;
const QUrl url(QStringLiteral("qrc:/main.qml"));
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl)
QCoreApplication::exit(-1);
}, Qt::QueuedConnection);
engine.load(url);
2020-10-09 00:03:50 +02:00
2020-10-08 20:06:57 +02:00
return app.exec();
}