diff options
author | Anatasof Wirapraja <anata@darapsa.co.id> | 2020-12-02 15:16:28 +0700 |
---|---|---|
committer | Anatasof Wirapraja <anata@darapsa.co.id> | 2020-12-02 15:16:28 +0700 |
commit | 284c2d501022d23e4cd860176443c5a502443f2f (patch) | |
tree | 6d90bb8f6dc024a0f083be70f8c904935d1d99af /main.cpp |
initial commit
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..db8d3b8 --- /dev/null +++ b/main.cpp @@ -0,0 +1,20 @@ +#include <QGuiApplication> +#include <QQmlApplicationEngine> + +int main(int argc, char *argv[]) +{ + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + + 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(); +} |