-
Notifications
You must be signed in to change notification settings - Fork 13
/
main.cpp
44 lines (34 loc) · 1.45 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
35
36
37
38
39
40
41
42
43
44
#include <QtQuick>
#include <QtGui>
#include <QtPlugin>
#include "store.h"
#include "quickvirtualkeyboard/register.h"
#include "grayImage.h"
Q_IMPORT_PLUGIN(QsgEpaperPlugin)
int main(int argc, char *argv[])
{
qputenv("QMLSCENE_DEVICE", "epaper");
qputenv("QT_QPA_PLATFORM", "epaper:enable_fonts");
qputenv("QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS", "rotate=180");
QGuiApplication app(argc, argv);
Store view;
qmlRegisterType<Store>();
auto context = view.rootContext();
context->setContextProperty("screenGeometry", app.primaryScreen()->geometry());
context->setContextProperty("store", &view);
context->setContextProperty("storeProg", QVariant(0));
context->setContextProperty("storeError", QVariant(""));
context->setContextProperty("titleVisible", QVariant(true));
QFontDatabase::addApplicationFont(":/fonts/MaisonNeue-Bold");
QFontDatabase::addApplicationFont(":/fonts/MaisonNeue-Demi");
QFontDatabase::addApplicationFont(":/fonts/MaisonNeue-Medium");
view.engine()->addImportPath(QStringLiteral(DEPLOYMENT_PATH));
view.engine()->addImageProvider(QLatin1String("gray"), new GrayImageProvider);
registerQmlTypes();
view.setSource(QUrl(QStringLiteral("qrc:/Main.qml")));
QObject::connect(view.engine(), &QQmlEngine::quit, &QGuiApplication::quit);
QObject::connect(&app, &QCoreApplication::aboutToQuit, [&view]() { delete &view; });
view.show();
view.open();
return app.exec();
}