summaryrefslogtreecommitdiffstats
path: root/src/gui/platform/ios/qiosnativeinterface.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2024-05-06 23:38:15 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2024-05-14 00:32:35 +0200
commit1f667ba70e91563c2b508a70291fdac8a814c150 (patch)
tree10b7680fe05f1cfd6f24f1bfa6cdfdc9a33af2eb /src/gui/platform/ios/qiosnativeinterface.cpp
parented71387d1cc06afff42ac844a3887778685ce793 (diff)
visionOS: Add support for immersive spaces
The QNativeInterface::QVisionOSApplication interface allows opening and dismissing an immersive space, as well as registering a compositor layer implementation that can be used to configure the compositor layer and render to it with Metal. The compositor layer implementation is consulted both for immersive spaces triggered explicitly, and when the default scene of the app is set to CPSceneSessionRoleImmersiveSpaceApplication via the UIApplicationPreferredDefaultSceneSessionRole in the Info.plist. All of this requires that the application follows the SwiftUI app lifecyle, so our application entrypoint is now a SwiftUI app. The existing qt_main_wrapper used for the QIOSEventDispatcher handles this transparently, so there is no change for the user, who will still receive a callback to main() when the Swift app is ready to build its UI hierarchy. Change-Id: Ic295010d714e90cd4d3f66bd90f321438659f3a6 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/gui/platform/ios/qiosnativeinterface.cpp')
-rw-r--r--src/gui/platform/ios/qiosnativeinterface.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gui/platform/ios/qiosnativeinterface.cpp b/src/gui/platform/ios/qiosnativeinterface.cpp
new file mode 100644
index 00000000000..c942709e334
--- /dev/null
+++ b/src/gui/platform/ios/qiosnativeinterface.cpp
@@ -0,0 +1,26 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include <QtGui/private/qguiapplication_p.h>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QNativeInterface::Private;
+
+#if defined(Q_OS_VISIONOS)
+
+/*!
+ \class QNativeInterface::QVisionOSApplication
+ \since 6.8
+ \internal
+ \preliminary
+ \brief Native interface to QGuiApplication, to be retrieved from QPlatformIntegration.
+ \inmodule QtGui
+ \ingroup native-interfaces
+*/
+
+QT_DEFINE_NATIVE_INTERFACE(QVisionOSApplication);
+
+#endif // Q_OS_VISIONOS
+
+QT_END_NAMESPACE