-
Notifications
You must be signed in to change notification settings - Fork 27
/
main.cpp
54 lines (41 loc) · 1.09 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
44
45
46
47
48
49
50
51
52
53
54
#include "mainwindow.h"
#include <QApplication>
#include <QFile>
#include <QGuiApplication>
QString openStyleFiles()
{
QString ret;
QFile mainStyleFile(":/resources/styleSheets/TInFStyles.qss");
#ifdef Q_OS_WIN
QFile appendedStyle(":/resources/styleSheets/TInFWin.qss");
#endif
#ifdef Q_OS_MACOS
QFile appendedStyle(":/resources/styleSheets/TInFMac.qss");
#endif
#ifdef Q_OS_LINUX
QFile appendedStyle(":/resources/styleSheets/TInFLinux.qss");
#endif
if (!mainStyleFile.open(QFile::ReadOnly))
{
return ret;
}
if (!appendedStyle.open(QFile::ReadOnly))
{
return ret;
}
ret = ret.append(mainStyleFile.readAll());
ret = ret.append(appendedStyle.readAll());
mainStyleFile.close();
appendedStyle.close();
return ret;
}
int main(int argc, char *argv[])
{
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
MainWindow w;
QApplication::setWindowIcon(QIcon(":/resources/NHERI-TInF-icon.icns"));
w.show();
app.setStyleSheet(openStyleFiles());
return app.exec();
}