-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
executable file
·45 lines (39 loc) · 1.48 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
45
#include "psa_main_window.h"
#include <QApplication>
#include <QLocale>
#include <QTranslator>
#include <QFontDatabase>
#include <iostream>
#include <QSplashScreen>
#include <stdio.h>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QSplashScreen splash(QPixmap(":/backgrounds/backgrounds/pezo2.png"));
splash.show();
QTranslator translator;
const QStringList uiLanguages = QLocale::system().uiLanguages();
for (const QString &locale : uiLanguages) {
const QString baseName = "psa-app_" + QLocale(locale).name();
if (translator.load(":/i18n/" + baseName)) {
a.installTranslator(&translator);
break;
}
}
QFontDatabase::addApplicationFont(":/fonts/fonts/dejavu_sans_mono.ttf");
QFontDatabase::addApplicationFont(":/fonts/fonts/DroidSansMono.ttf");
QFontDatabase::addApplicationFont(":/fonts/fonts/AzeretMono-BoldItalic.ttf");
QFontDatabase::addApplicationFont(":/fonts/fonts/DSEG7Classic-Bold.ttf");
QFontDatabase::addApplicationFont(":/fonts/fonts/DSEG14Modern-Bold.ttf");
QFontDatabase::addApplicationFont(":/fonts/fonts/DSEG14Classic-Bold.ttf");
QFontDatabase::addApplicationFont(":/fonts/fonts/Dotsalfn.ttf");
QFontDatabase::addApplicationFont(":/fonts/fonts/PSAGroupeHMISansCS-Bold.ttf");
psa_main_window w;
w.show();
w.display_selected_window();
a.processEvents();
splash.finish(&w);
w.display_selected_window();
a.processEvents();
return a.exec();
}