-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.cpp
29 lines (27 loc) · 945 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
#include <QGuiApplication>
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QFileInfo>
#include <QTranslator>
#include <QIcon>
#include <QDebug>
#include "ql-channel-serial.hpp"
int main(int argc, char *argv[])
{
#if defined(Q_OS_WIN)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QString locale = QLocale::system().name().split("_").at(0);
QTranslator translator;
translator.load("NoTer_"+locale);
QGuiApplication app(argc, argv);
app.installTranslator(&translator);
QFileInfo fi(app.applicationDirPath() + "/../share/icons/hicolor/256x256/apps/NoTer.png");
QApplication::setWindowIcon(QIcon(fi.absoluteFilePath()));
qmlRegisterType<QlChannelSerial>("QlChannelSerial",1,0,"QlChannelSerial");
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}