-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
42 lines (35 loc) · 970 Bytes
/
main.cpp
File metadata and controls
42 lines (35 loc) · 970 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
32
33
34
35
36
37
38
39
40
41
42
#include "iconproxystyle.h"
#include "mainwindow.h"
#include <QApplication>
#include <QTranslator>
#include <QLibraryInfo>
#include <QLocale>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setStyle("Plastique");
QIcon::setThemeName("HighContrast");
QString translationsPath(QLibraryInfo::location(QLibraryInfo::TranslationsPath));
QLocale locale = QLocale::system();
// material
// gnome
// HighContrast
QTranslator qtTranslator;
if (qtTranslator.load(locale, "qt", "_", translationsPath))
{
a.installTranslator(&qtTranslator);
}
QTranslator qtBaseTranslator;
if (qtBaseTranslator.load(locale, "qtbase", "_", translationsPath))
{
a.installTranslator(&qtBaseTranslator);
}
QTranslator dictionaryTranslator;
if (dictionaryTranslator.load(locale, ":/files/dictionary_translator", "_"))
{
a.installTranslator(&dictionaryTranslator);
}
MainWindow w;
w.show();
return a.exec();
}