-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
31 lines (26 loc) · 732 Bytes
/
Copy pathmain.cpp
File metadata and controls
31 lines (26 loc) · 732 Bytes
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
#include "mainwindow.h"
#include <QApplication>
#include <QLocale>
#include <QTranslator>
#include <QSurfaceFormat>
int main(int argc, char *argv[])
{
// create the QT application
QApplication a(argc, argv);
// add localization
QTranslator translator;
const QStringList uiLanguages = QLocale::system().uiLanguages();
for (const QString &locale : uiLanguages) {
const QString baseName = "PaperariumDesign_" + QLocale(locale).name();
if (translator.load(":/i18n/" + baseName)) {
a.installTranslator(&translator);
break;
}
}
// show the main window
MainWindow w;
w.show();
w.raise();
// execute the application
return a.exec();
}