-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
42 lines (28 loc) · 1.05 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
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QQmlEngine>
#include "QtLibSSH/sessionessh.h"
#include <QtQml>
#include <QTranslator>
#include <QObject>
#include <QDebug>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QTranslator translator;
QString locale = QLocale::system().name();
// qDebug() << "LOCALE:" << locale;
if (! locale.contains("it_",Qt::CaseInsensitive))
{
translator.load(QString(":/translations/remoteexecuter_default.ts"));
app.installTranslator(&translator);
}
QQmlApplicationEngine engine;
qRegisterMetaType<CodiceErrore>("CodiceErrore");
qRegisterMetaTypeStreamOperators<CodiceErrore>("CodiceErrore");
qmlRegisterType<CodiceErrore>("org.pxpert.CodiceErrore", 1, 0, "CodiceErrore");
qmlRegisterType<SessioneSSH>("org.pxpert.SessioneSSH", 1, 0, "SessioneSSH");
QObject::connect(&engine, SIGNAL(quit()), &app, SLOT(quit())); // to make Qt.quit() to work.
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();
}