-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
53 lines (41 loc) · 1.11 KB
/
main.cpp
File metadata and controls
53 lines (41 loc) · 1.11 KB
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
46
47
48
49
50
51
52
53
#include "mainwindow.h"
#include "helpfunc.h"
#include <QApplication>
#include <QDir>
#include <QMessageBox>
#include "singleapplication.h"
#include <QTranslator>
#include <QSharedMemory>
#include <QStyleFactory>
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
# pragma execution_character_set("utf-8")
#endif
#define APP_VERSION "1.3.0"
int main(int argc, char *argv[])
{
#ifdef HAVE_WAYLAND
qputenv("QT_QPA_PLATFORM", "xcb");
#endif
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#if (QT_VERSION > QT_VERSION_CHECK(5,14,0))
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
SingleApplication a(argc, argv);
if(a.isRunning())
{
return 0;
}
a.setApplicationVersion(APP_VERSION);
ensureAppDirs();
#ifdef Q_OS_LINUX
a.setStyle(QStyleFactory::create("Fusion"));
#endif
QTranslator translator;
translator.load(":/translations/widgets.qm");
a.installTranslator(&translator);
MainWindow w;
a.w = &w;
w.show();
return a.exec();
}