diff options
author | Paul Wicking <paul.wicking@qt.io> | 2022-12-05 10:24:40 +0100 |
---|---|---|
committer | Paul Wicking <paul.wicking@qt.io> | 2022-12-07 02:06:40 +0000 |
commit | e37459cc88c2018b36f5fb70dd1c56db70c42487 (patch) | |
tree | 7243a39f39db9ec8699b4ca3f540caaab6134e28 /tests/manual/quickcontrols/material/material.cpp | |
parent | 5ce3b931fec49eb77912d1510342d1d341c6cac7 (diff) | |
download | qtdeclarative-wip/material3.tar.gz |
Move manual test for material stylewip/material3
After the renaming, tests/manual/quickcontrols2 is now
tests/manual/quickcontrols.
Change-Id: I95b34c68b6e684052e98a4bf0561beb9c9750efe
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/manual/quickcontrols/material/material.cpp')
-rw-r--r-- | tests/manual/quickcontrols/material/material.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/manual/quickcontrols/material/material.cpp b/tests/manual/quickcontrols/material/material.cpp new file mode 100644 index 0000000000..2e257b0902 --- /dev/null +++ b/tests/manual/quickcontrols/material/material.cpp @@ -0,0 +1,32 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +#include <QGuiApplication> +#include <QQmlApplicationEngine> +#include <QSettings> + +int main(int argc, char *argv[]) +{ + QGuiApplication::setApplicationName("material"); + QGuiApplication::setOrganizationName("QtProject"); + + QGuiApplication app(argc, argv); + + const char *variantEnvVar = "QT_QUICK_CONTROLS_MATERIAL_VARIANT"; + if (!qEnvironmentVariableIsSet(variantEnvVar)) { + QSettings settings; + const char *variant = "variant"; + if (settings.contains(variant)) + qputenv(variantEnvVar, settings.value(variant).toByteArray()); + } + + QQmlApplicationEngine engine; + const QUrl url(QStringLiteral("qrc:/material.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(); +} |