Repository navigation
Expand file tree
/
Copy pathmain.cpp
More file actions
57 lines (47 loc) · 1.88 KB
/
Copy pathmain.cpp
File metadata and controls
57 lines (47 loc) · 1.88 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
/**
* @file main.cpp
* @brief Groundwave application entry point
*/
#include "gui/main_window.hpp"
#include "gui/style.hpp"
#include "include/app_state.hpp"
#include <QApplication>
#include <QSurfaceFormat>
#include <QFont>
#include <QFontDatabase>
#include <QIcon>
#include <QString>
int main(int argc, char* argv[]) {
// HiDPI is always enabled in Qt 6 — no setAttribute needed
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
#endif
QApplication app(argc, argv);
app.setApplicationName("Groundwave");
app.setOrganizationName("Groundwave");
// Derived from the CMake project version (GW_VERSION_* compile defs) so
// it never drifts from the single source of truth.
app.setApplicationVersion(QStringLiteral("%1.%2.%3")
.arg(GW_VERSION_MAJOR).arg(GW_VERSION_MINOR).arg(GW_VERSION_PATCH));
// Window/taskbar icon: the carrier-comb mark (assets/icon). The 256
// covers large contexts, the 32 keeps title bars crisp; the EXE's
// Explorer icon comes from the .rc resource instead.
QIcon app_icon(":/icon/groundwave_256.png");
app_icon.addFile(":/icon/groundwave_32.png");
app.setWindowIcon(app_icon);
// Apply global stylesheet
app.setStyleSheet(gw::style::buildStyleSheet());
// System font — prefer SF Pro on macOS, Segoe UI on Windows, system sans elsewhere
QFont default_font = app.font();
default_font.setFamily("-apple-system, SF Pro Text, Segoe UI, Helvetica Neue, DejaVu Sans");
default_font.setPixelSize(12);
default_font.setHintingPreference(QFont::PreferFullHinting);
app.setFont(default_font);
// Application-wide state (owns all DSP data, no Qt deps)
gw::AppState state;
// Main window
gw::MainWindow window(state);
window.show();
return app.exec();
}