12#if QT_CONFIG(clipboard)
20#if defined(Q_OS_VISIONOS)
21#include "qiosswiftintegration.h"
24#include <QtGui/qpointingdevice.h>
25#include <QtGui/private/qguiapplication_p.h>
26#include <QtGui/private/qrhibackingstore_p.h>
29#include <qpa/qplatformoffscreensurface.h>
31#include <QtGui/private/qcoretextfontdatabase_p.h>
32#include <QtGui/private/qmacmimeregistry_p.h>
33#include <QtGui/qutimimeconverter.h>
35#include <QOperatingSystemVersion>
41#import <AudioToolbox/AudioServices.h>
67 qFatal(
"Error: You are creating QApplication before calling UIApplicationMain.\n" \
68 "If you are writing a native iOS application, and only want to use Qt for\n" \
69 "parts of the application, a good place to create QApplication is from within\n" \
70 "'applicationDidFinishLaunching' inside your UIApplication delegate.\n");
79#if defined(Q_OS_VISIONOS)
83 UIScreen *mainScreen = [UIScreen mainScreen];
84 NSMutableArray<UIScreen *> *screens = [[[UIScreen screens] mutableCopy] autorelease];
85 if (![screens containsObject:mainScreen]) {
87 [screens insertObject:mainScreen atIndex:0];
100#if !defined(Q_OS_VISIONOS)
101 if (mainScreen.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)
104 m_touchDevice->setCapabilities(touchCapabilities);
106#if QT_CONFIG(tabletevent)
113 qobject_cast<QIosOptionalPluginInterface *>(m_optionalPlugins->
instance(
i))->initPlugin();
118 delete m_fontDatabase;
121#if QT_CONFIG(clipboard)
128 delete m_inputContext;
134 delete m_platformServices;
135 m_platformServices = 0;
137 delete m_accessibility;
140 delete m_optionalPlugins;
141 m_optionalPlugins = 0;
204 bool isValid()
const override {
return true; }
219 return m_fontDatabase;
222#if QT_CONFIG(clipboard)
231 return m_inputContext;
236 return m_platformServices;
272 return m_touchDevice;
275#if QT_CONFIG(accessibility)
276QPlatformAccessibility *QIOSIntegration::accessibility()
const
278 if (!m_accessibility)
279 m_accessibility =
new QIOSPlatformAccessibility;
280 return m_accessibility;
291#if !TARGET_IPHONE_SIMULATOR
292 AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
298 UIApplication.sharedApplication.applicationIconBadgeNumber =
number;
303#if defined(Q_OS_VISIONOS)
304void QIOSIntegration::openImmersiveSpace()
306 [ImmersiveSpaceManager openImmersiveSpace];
309void QIOSIntegration::dismissImmersiveSpace()
311 [ImmersiveSpaceManager dismissImmersiveSpace];
316 m_immersiveSpaceCompositorLayer =
layer;
319void QIOSIntegration::configureCompositorLayer(cp_layer_renderer_capabilities_t capabilities,
320 cp_layer_renderer_configuration_t configuration)
322 if (m_immersiveSpaceCompositorLayer)
323 m_immersiveSpaceCompositorLayer->configure(capabilities, configuration);
326void QIOSIntegration::renderCompositorLayer(cp_layer_renderer_t
renderer)
328 if (m_immersiveSpaceCompositorLayer)
329 m_immersiveSpaceCompositorLayer->render(
renderer);
345 if (lowerCaseResource ==
"uiview")
346 return reinterpret_cast<void *
>(platformWindow->
winId());
355#include "moc_qiosintegration.cpp"
QByteArray toLower() const &
static bool setCurrent(const QString &path)
Sets the application's current working directory to path.
MetaDataList metaData() const
QObject * instance(int index) const
static QPlatformIntegration * platformIntegration()
static QList< QScreen * > screens()
Returns a list of all the screens associated with the windowing system the application is connected t...
static QIOSEventDispatcher * create()
void initialize() override
Performs initialization steps that depend on having an event dispatcher available.
QVariant styleHint(StyleHint hint) const override
QPlatformTheme * createPlatformTheme(const QString &name) const override
void * nativeResourceForWindow(const QByteArray &resource, QWindow *window) override
void beep() const override
static QIOSIntegration * instance()
QPlatformOffscreenSurface * createPlatformOffscreenSurface(QOffscreenSurface *surface) const override
Factory function for QOffscreenSurface.
QPlatformWindow * createForeignWindow(QWindow *window, WId nativeHandle) const override
void setApplicationBadge(qint64 number) override
QPointingDevice * touchDevice()
QPlatformBackingStore * createPlatformBackingStore(QWindow *window) const override
Factory function for QPlatformBackingStore.
QStringList themeNames() const override
QPlatformNativeInterface * nativeInterface() const override
QAbstractEventDispatcher * createEventDispatcher() const override
Factory function for the GUI event dispatcher.
QPlatformServices * services() const override
bool hasCapability(Capability cap) const override
QPlatformInputContext * inputContext() const override
Returns the platforms input context.
QPlatformFontDatabase * fontDatabase() const override
Accessor for the platform integration's fontdatabase.
QPlatformWindow * createPlatformWindow(QWindow *window) const override
Factory function for QPlatformWindow.
bool isValid() const override
Returns true if the platform offscreen surface has been allocated.
QIOSOffscreenSurface(QOffscreenSurface *offscreenSurface)
QSurfaceFormat format() const override
Returns the actual surface format of the offscreen surface.
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
QSurfaceFormat requestedFormat() const
Returns the requested surfaceformat of this offscreen surface.
The QPlatformInputContext class abstracts the input method dependent data and composing state.
The QPlatformOpenGLContext class provides an abstraction for native GL contexts.
The QPointingDevice class describes a device from which mouse, touch or tablet events originate.
The QScreen class is used to query screen properties. \inmodule QtGui.
QPlatformScreen * handle() const
Get the platform screen handle.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static void setPlatformSynthesizesMouse(bool v)
static void registerInputDevice(const QInputDevice *device)
static void handleScreenAdded(QPlatformScreen *screen, bool isPrimary=false)
Should be called by the implementation whenever a new screen is added.
static void handleScreenRemoved(QPlatformScreen *screen)
Should be called by the implementation whenever a screen is removed.
void initializeMimeTypes()
Combined button and popup list for selecting options.
QList< QString > QStringList
Constructs a string list that contains the given string, str.
bool qt_apple_isApplicationExtension()
AppleApplication * qt_apple_sharedApplication()
#define QIosOptionalPluginInterface_iid
GLenum GLuint GLintptr GLsizeiptr size
[1]
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
#define QT_CONFIG(feature)
if(qFloatDistance(a, b)<(1<< 7))
[0]
QSvgRenderer * renderer
[0]