forked from ekke/drawer_nav_x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
32 lines (26 loc) · 1009 Bytes
/
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
// ekke (Ekkehard Gentz) @ekkescorner
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QDebug>
#include <QTranslator>
#include <QQmlContext>
#include "applicationui.hpp"
int main(int argc, char *argv[])
{
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
qputenv("QT_QUICK_CONTROLS_STYLE", "material");
QGuiApplication app(argc, argv);
QTranslator translator;
if (translator.load(QLocale(), QLatin1String("drawer_nav_x"), QLatin1String("_"), QLatin1String(":/translations"))) {
app.installTranslator(&translator);
} else {
qDebug() << "cannot load translator " << QLocale::system().name() << " check content of translations.qrc";
}
ApplicationUI appui;
QQmlApplicationEngine engine;
// from QML we have access to ApplicationUI as myApp
QQmlContext* context = engine.rootContext();
context->setContextProperty("myApp", &appui);
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();
}