summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools/qt_cmake_create/testdata/qml_project/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/tools/qt_cmake_create/testdata/qml_project/main.cpp')
-rw-r--r--tests/auto/tools/qt_cmake_create/testdata/qml_project/main.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/tools/qt_cmake_create/testdata/qml_project/main.cpp b/tests/auto/tools/qt_cmake_create/testdata/qml_project/main.cpp
new file mode 100644
index 0000000000..13c7014d8c
--- /dev/null
+++ b/tests/auto/tools/qt_cmake_create/testdata/qml_project/main.cpp
@@ -0,0 +1,18 @@
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ QQmlApplicationEngine engine;
+ const QUrl url(QStringLiteral("qrc:/qt/qml/qml_project/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();
+}