-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
64 lines (52 loc) · 1.78 KB
/
Copy pathmain.cpp
File metadata and controls
64 lines (52 loc) · 1.78 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
#include "mainwindow.h"
#include "appmanager.h"
#include "configmanager.h"
#include <QApplication>
#include <QLocale>
#include <QTranslator>
#include <QFontDatabase>
int main(int argc, char *argv[])
{
qDebug() << "🟢 main() 진입";
QApplication app(argc, argv);
ConfigManager::load();
QStringList fontPaths = {
":/01HanwhaB.ttf",
":/03HanwhaL.ttf",
":/05HanwhaGothicR.ttf",
":/06HanwhaGothicL.ttf",
":/07HanwhaGothicEL.ttf",
":/Pretendard-Regular.ttf"
};
QString defaultFontFamily;
for (const QString &path : fontPaths) {
int id = QFontDatabase::addApplicationFont(path);
if (id == -1) {
qWarning() << " Failed to load font:" << path;
} else {
QStringList families = QFontDatabase::applicationFontFamilies(id);
qDebug() << " Loaded:" << path << "→" << families;
if (path.contains("hanwhaGothic L")) {
defaultFontFamily = families.first();
}
}
}
if (!defaultFontFamily.isEmpty()) {
QFont defaultFont(defaultFontFamily, 11);
QApplication::setFont(defaultFont);
}
QTranslator translator;
const QStringList uiLanguages = QLocale::system().uiLanguages();
for (const QString &locale : uiLanguages) {
const QString baseName = "Busbomproject_" + QLocale(locale).name();
if (translator.load(":/i18n/" + baseName)) {
app.installTranslator(&translator);
break;
}
}
AppManager manager; // LoginPage → MainWindow 전환
manager.show();
int result = app.exec(); //이벤트 루프 진입 : 마우스클릭, 키보드 입력 등 Qt가 내부적으로 감시
qDebug() << " main() 종료, 코드:" << result;
return result;
}