-
Notifications
You must be signed in to change notification settings - Fork 21
/
main.cpp
executable file
·73 lines (56 loc) · 1.49 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "mainwindow.h"
#include <QApplication>
#include <QResource>
#include <QFile>
//#include <QDir>
QString openStyleFiles()
{
QString ret;
QFile mainStyleFile(":/resources/styleSheets/pgtStyles.qss");
#ifdef Q_OS_WIN
QFile appendedStyle(":/resources/styleSheets/pgtWin.qss");
#endif
#ifdef Q_OS_MACOS
QFile appendedStyle(":/resources/styleSheets/pgtMac.qss");
#endif
#ifdef Q_OS_LINUX
QFile appendedStyle(":/resources/styleSheets/pgtLinux.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[])
{
QApplication app(argc, argv);
bool graphicModeQCP = false;
#ifdef USEQCP
for (int i = 0; i < argc; i++)
{
if (strcmp(argv[i],"-useQCP") == 0
|| strcmp(argv[i],"-QCP") == 0
|| strcmp(argv[i],"-useqcp") == 0
|| strcmp(argv[i],"-qcp") == 0)
{
graphicModeQCP = true;
}
}
#else
graphicModeQCP = false;
#endif
MainWindow w(graphicModeQCP);
QApplication::setWindowIcon(QIcon(":/resources/NHERI-PGT-Icon.icns"));
w.show();
app.setStyleSheet(openStyleFiles());
return app.exec();
}