-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (26 loc) · 751 Bytes
/
main.cpp
File metadata and controls
33 lines (26 loc) · 751 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
#include "mainwindow.h"
#include <QApplication>
#include <QTranslator>
#include <QFile>
int main(int argc, char *argv[])
{
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#else
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Round);
#endif
QApplication a(argc, argv);
QTranslator q;
if (q.load(":/qm/qtbase_zh_CN.qm"))
a.installTranslator(&q);
QTranslator t;
if (t.load(":/qm/zh_CN.qm"))
a.installTranslator(&t);
QFile file(":/qss/onekeyword.qss");
file.open(QIODevice::ReadOnly);
qApp->setStyleSheet(file.readAll());
file.close();
MainWindow w;
w.show();
return a.exec();
}