diff options
author | crupest <crupest@outlook.com> | 2023-10-17 22:02:25 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2023-10-17 22:02:25 +0800 |
commit | e09b474e2e9fb9ae87536bdce5c8df3c5f8006ee (patch) | |
tree | 8554f8c4de21603d13dd5d306514c77e14f083df /works/teapot/main.cpp | |
download | crupest-e09b474e2e9fb9ae87536bdce5c8df3c5f8006ee.tar.gz crupest-e09b474e2e9fb9ae87536bdce5c8df3c5f8006ee.tar.bz2 crupest-e09b474e2e9fb9ae87536bdce5c8df3c5f8006ee.zip |
import(teapot): Startup!
Diffstat (limited to 'works/teapot/main.cpp')
-rw-r--r-- | works/teapot/main.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/works/teapot/main.cpp b/works/teapot/main.cpp new file mode 100644 index 0000000..804f8ff --- /dev/null +++ b/works/teapot/main.cpp @@ -0,0 +1,20 @@ +// Copyright (C) 2019 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#include <QGuiApplication> +#include <QQmlApplicationEngine> +#include <QtQuick3D/qquick3d.h> + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + QSurfaceFormat::setDefaultFormat(QQuick3D::idealSurfaceFormat()); + qputenv("QT_QUICK_CONTROLS_STYLE", "Basic"); + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + if (engine.rootObjects().isEmpty()) + return -1; + + return app.exec(); +} |