-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
69 lines (56 loc) · 1.79 KB
/
main.cpp
File metadata and controls
69 lines (56 loc) · 1.79 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef MAIN_CPP
#define MAIN_CPP
#include <QApplication>
#include <QSettings>
#include <QTranslator>
#include "hexMerger.h"
#include "hexMerger.cpp"
int main(int argc, char **argv) {
Q_INIT_RESOURCE(hexMerger);
QApplication app(argc, argv);
QTranslator translator;
QString locale = QLocale::system().name().section('_', 0, 0);
#ifdef Q_OS_MAC
QDir topDir(QApplication::applicationDirPath());
topDir.cdUp();
topDir.cd("Resources");
translator.load(("hexMerger_" + locale + ".qm"), topDir.absolutePath() + QDir::separator() + "lang");
#else
translator.load(("hexMerger_" + locale + ".qm"), (QApplication::applicationDirPath() + QDir::separator() + "lang"));
#endif
app.installTranslator(&translator);
app.setWindowIcon(QIcon(":/appicon.png"));
app.setOrganizationName("HexMerger");
app.setApplicationName("HexMerger");
#ifdef Q_OS_MAC
QFile css((topDir.absolutePath() + QDir::separator() + "styles/macStyles.css"));
if (css.open(QIODevice::ReadOnly | QIODevice::Text))
{
QTextStream cssStream(&css);
app.setStyleSheet(cssStream.readAll());
css.close();
}
#endif
#ifdef Q_OS_LINUX
QFile css((QApplication::applicationDirPath() + QDir::separator() + "styles/lnxStyles.css"));
if (css.open(QIODevice::ReadOnly | QIODevice::Text))
{
QTextStream cssStream(&css);
app.setStyleSheet(cssStream.readAll());
css.close();
}
#endif
#ifdef Q_OS_WIN
QFile css((QApplication::applicationDirPath() + QDir::separator() + "styles\\winStyles.css"));
if (css.open(QIODevice::ReadOnly | QIODevice::Text))
{
QTextStream cssStream(&css);
app.setStyleSheet(cssStream.readAll());
css.close();
}
#endif
hexMerger mainWindow;
mainWindow.show();
return app.exec();
}
#endif