Add CLI arguments parsing + --start-in-tray

- Loading a QML file in place of src/gui/UI.qml is now possible via
  -l / --load-qml instead of taking the first positional argument

- New option to start application in tray without showing a window

- --help and --version
This commit is contained in:
miruka
2021-01-09 04:46:56 -04:00
parent 50d4aae188
commit fda5bc0039
5 changed files with 68 additions and 3 deletions

View File

@@ -186,7 +186,9 @@ int main(int argc, char *argv[]) {
QQmlContext *objectContext = new QQmlContext(engine.rootContext());
// To able to use Qt.quit() from QML side
QObject::connect(&engine, &QQmlEngine::quit, &QApplication::quit);
QObject::connect(
&engine, &QQmlEngine::quit, &app, &QApplication::quit, Qt::QueuedConnection
);
// Set the debugMode properties depending of if we're running in debug mode
// or not (`qmake CONFIG+=dev ...`, default in autoreload.py)