-
Notifications
You must be signed in to change notification settings - Fork 22
/
main.cpp
43 lines (32 loc) · 1.08 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
#include "main.h"
#include "MainWindow.h"
#include "Dialogs/PreferencesKeys.h"
#include <QApplication>
#include <QSettings>
#include <QStyle>
#include <QStyleFactory>
QString defaultStyle = "";
int main(int argc, char *argv[]) {
// must enable high DPI before QApplication constructor
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication a(argc, argv);
a.setOrganizationName("ENIGMA Dev Team");
a.setOrganizationDomain("enigma-dev.org");
a.setApplicationName("RadialGM");
a.setWindowIcon(QIcon(":/icon.ico"));
a.setAttribute(Qt::AA_DisableWindowContextHelpButton);
defaultStyle = a.style()->objectName();
QSettings settings;
settings.beginGroup(preferencesKey());
settings.beginGroup(appearanceKey());
const QString &styleName = settings.value(styleNameKey()).toString();
QApplication::setStyle(styleName);
settings.endGroup(); // Preferences/Appearance
settings.endGroup(); // Preferences
MainWindow w(nullptr);
if (argc > 1) {
w.openFile(QString(argv[1]));
}
w.show();
return a.exec();
}