2020-10-08 20:06:57 +02:00
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QQmlApplicationEngine>
|
2020-10-11 15:50:13 +02:00
|
|
|
#include <QQuickStyle>
|
2020-10-09 00:03:50 +02:00
|
|
|
#include <qbluetoothleuart.h>
|
2020-10-08 20:06:57 +02:00
|
|
|
|
|
|
|
#include "omobidisplaybackend.h"
|
2020-10-11 21:01:21 +02:00
|
|
|
#include "omobidisplaytextmodel.h"
|
2020-10-08 20:06:57 +02:00
|
|
|
|
|
|
|
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");
|
2020-10-11 21:01:21 +02:00
|
|
|
qmlRegisterUncreatableType<OmobiDisplayTextModel>("de.itsblue.omobidisplayapp", 1, 0, "OmobiDisplayTextModel", "OmobiDisplayTextModel cannot be created");
|
2020-10-09 00:03:50 +02:00
|
|
|
QBluetoothLeUart::init();
|
2020-10-08 20:06:57 +02:00
|
|
|
|
2020-10-11 15:50:13 +02:00
|
|
|
QQuickStyle::setStyle("Material");
|
|
|
|
|
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();
|
|
|
|
}
|