-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
30 lines (26 loc) · 779 Bytes
/
Copy pathmain.cpp
File metadata and controls
30 lines (26 loc) · 779 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
#include "mainwindow.h"
#include <QApplication>
#include <QTranslator>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// 根据用户语言环境设置翻译文件
QTranslator translator;
QString locale = QLocale::system().name();
QString loadFileName;
QList<QString> supportLangs = {"en_US", "ru_RU", "zh_CN"};
if (supportLangs.contains(locale))
{
loadFileName = QString(":/translations/MisideTrainer_%1.qm").arg(locale);
if (translator.load(loadFileName))
{
a.installTranslator(&translator);
}
}
MainWindow w;
w.setWindowIcon(QIcon(":/icons/app_icon.ico"));
w.setFixedSize(480, 720);
w.setWindowTitle("MisideFull Trainer");
w.show();
return a.exec();
}