-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
54 lines (48 loc) · 1.41 KB
/
main.cpp
File metadata and controls
54 lines (48 loc) · 1.41 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
#include "mainwindow.h"
#include <QFontDatabase>
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
int fontId = QFontDatabase::addApplicationFont(":/fonts/fonts/Courier_New.ttf");
if (fontId == -1) {
qWarning("Failed to load cn!");
}
fontId = QFontDatabase::addApplicationFont(":/fonts/fonts/Courier_Prime.ttf");
if (fontId == -1) {
qWarning("Failed to load cp!");
}
fontId = QFontDatabase::addApplicationFont(":/fonts/fonts/DroidSansMono.ttf");
if (fontId == -1) {
qWarning("Failed to load dsm!");
}
fontId = QFontDatabase::addApplicationFont(":/fonts/fonts/SourceCodePro-Regular.ttf");
if (fontId == -1) {
qWarning("Failed to load scp!");
}
fontId = QFontDatabase::addApplicationFont(":/fonts/fonts/UbuntuMono-R.ttf");
if (fontId == -1) {
qWarning("Failed to load umr!");
}
fontId = QFontDatabase::addApplicationFont(":/fonts/fonts/Monospace.ttf");
if (fontId == -1) {
qWarning("Failed to load ms!");
}
fontId = QFontDatabase::addApplicationFont(":/fonts/fonts/Monaco.ttf");
if (fontId == -1) {
qWarning("Failed to load mc!");
}
if (fontId == -1) {
// Handle font loading error
qWarning("Failed to load font!");
}
qDebug() << "Arg count: " << argc << "Argv: " << argv;
QString fileName;
if (argc > 1) {
fileName = a.arguments().at(1);
}
a.setWindowIcon(QIcon(":/resources/Python.ico"));
MainWindow w(fileName);
w.show();
return a.exec();
}