diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-03-23 03:23:27 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-03-23 03:23:37 +0100 |
| commit | 4e5e0ba604879c140c1483188ffbc818e822859f (patch) | |
| tree | c37d8fc400386705aebdc649105ea3f87e1caf66 /main.cpp | |
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..104e9fc --- /dev/null +++ b/main.cpp @@ -0,0 +1,21 @@ +#include <QGuiApplication> +#include <QQmlApplicationEngine> + +int main(int argc, char *argv[]) +{ +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); +#endif + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + const QUrl url(QStringLiteral("qrc:/main.qml")); + QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, + &app, [url](QObject *obj, const QUrl &objUrl) { + if (!obj && url == objUrl) + QCoreApplication::exit(-1); + }, Qt::QueuedConnection); + engine.load(url); + + return app.exec(); +} |
