diff options
| author | Timotej Lazar <timotej.lazar@araneo.si> | 2021-06-14 19:09:53 +0200 |
|---|---|---|
| committer | Timotej Lazar <timotej.lazar@araneo.si> | 2021-06-14 19:13:14 +0200 |
| commit | 8d57bfb1aef3b71557bc408154ee028751fd688e (patch) | |
| tree | 22ee6eaa22a3cfc7dfd4f938be16a6e28d7eaf1f /main.cpp | |
First commit
There was history before but now there is no more.
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
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 <exception> + +#include <QApplication> +#include <QCommandLineParser> +#include <QIcon> +#include <QObject> +#include <QQmlApplicationEngine> +#include <QQmlContext> +#include <QQmlEngine> +#include <QTextCodec> +#include <QTextStream> +#include <QTranslator> +#include <QtDebug> + +#include <io.h> + +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; +} |
