diff options
Diffstat (limited to 'tests/manual/qardboard/main.cpp')
-rw-r--r-- | tests/manual/qardboard/main.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/manual/qardboard/main.cpp b/tests/manual/qardboard/main.cpp new file mode 100644 index 000000000..7d5ac86c2 --- /dev/null +++ b/tests/manual/qardboard/main.cpp @@ -0,0 +1,38 @@ +// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include <Qt3DQuickExtras/qt3dquickwindow.h> +#include <Qt3DQuick/QQmlAspectEngine> +#include <QGuiApplication> +#include <QQmlEngine> +#include <QQmlContext> + +#ifdef Q_OS_IOS +#include "iosdeviceorientation.h" +#else +#include "dummydeviceorientation.h" +#endif + +int main(int argc, char* argv[]) +{ + QGuiApplication app(argc, argv); + + Qt3DExtras::Quick::Qt3DQuickWindow view; + +#ifdef Q_OS_IOS + qmlRegisterType<iOSDeviceOrientation>("Qardboard", 1, 0, "DeviceOrientation"); +#else + qmlRegisterType<DummyDeviceOrientation>("Qardboard", 1, 0, "DeviceOrientation"); +#endif + + view.engine()->qmlEngine()->rootContext()->setContextProperty(QStringLiteral("_window"), &view); + view.setSource(QUrl("qrc:/main.qml")); +#ifdef Q_OS_IOS + view.showFullScreen(); +#else + view.resize(800, 400); + view.show(); +#endif + + return app.exec(); +} |