From 8d57bfb1aef3b71557bc408154ee028751fd688e Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Mon, 14 Jun 2021 19:09:53 +0200 Subject: First commit There was history before but now there is no more. --- main.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 main.cpp (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..a388f27 --- /dev/null +++ b/main.cpp @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: Unlicense + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +int main(int argc, char *argv[]) +try { + if (QIcon::themeName().isEmpty()) { + QIcon::setThemeSearchPaths(QIcon::themeSearchPaths() << ":/icons");; + QIcon::setThemeName("breeze"); + } + + QApplication app{argc, argv}; + app.setOrganizationName("fuzbal"); + app.setApplicationName("fuzbal"); + app.setApplicationVersion(GIT_VERSION); + + QTranslator translator; + translator.load(QLocale(), "fuzbal", "_", ":/i18n"); + app.installTranslator(&translator); + + QCommandLineParser parser; + parser.setApplicationDescription("Friendly Usable Zero-Bullshit Annotator & Labeler"); + parser.addHelpOption(); + parser.addVersionOption(); + parser.process(app); + + IO io; + + QQmlApplicationEngine engine; + engine.rootContext()->setContextProperty("io", &io); + engine.load(QUrl{"qrc:/main.qml"}); + + return app.exec(); +} catch (std::exception &e) { + qCritical() << "critical error:" << e.what(); + return 1; +} catch (...) { + qCritical() << "critical error"; + return 1; +} -- cgit v1.3