Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qioswindow.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QIOSWINDOW_H
6#define QIOSWINDOW_H
7
8#include <qpa/qplatformwindow.h>
9#include <qpa/qwindowsysteminterface.h>
10
11#import <UIKit/UIKit.h>
12
13@class QUIView;
14
15QT_BEGIN_NAMESPACE
16
17class QIOSWindow : public QObject, public QPlatformWindow
18{
19 Q_OBJECT
20
21public:
22 explicit QIOSWindow(QWindow *window, WId nativeHandle = 0);
23 ~QIOSWindow();
24
25 void setGeometry(const QRect &rect) override;
26
27 void setWindowState(Qt::WindowStates state) override;
28 void setParent(const QPlatformWindow *window) override;
29 void setVisible(bool visible) override;
30 void setOpacity(qreal level) override;
31
32 bool isExposed() const override;
33 void propagateSizeHints() override {}
34
35 QMargins safeAreaMargins() const override;
36
37 void raise() override{ raiseOrLower(true); }
38 void lower() override { raiseOrLower(false); }
39
40 bool shouldAutoActivateWindow() const;
41 void requestActivateWindow() override;
42
43 qreal devicePixelRatio() const override;
44
45 bool setMouseGrabEnabled(bool grab) override { return grab; }
46 bool setKeyboardGrabEnabled(bool grab) override { return grab; }
47
48 WId winId() const override { return WId(m_view); }
49
50 void clearAccessibleCache();
51
52 QSurfaceFormat format() const override;
53
54 void requestUpdate() override;
55
56 void setMask(const QRegion &region) override;
57
58#if QT_CONFIG(opengl)
59 CAEAGLLayer *eaglLayer() const;
60#endif
61
62 bool isForeignWindow() const override;
63 UIView *view() const;
64
65private:
66 void applicationStateChanged(Qt::ApplicationState state);
67 void applyGeometry(const QRect &rect);
68
69 UIView *m_view;
70
71 QRect m_normalGeometry;
72
73 void raiseOrLower(bool raise);
74 int windowLevel() const;
75 bool blockedByModal();
76
77 friend class QIOSScreen;
78};
79
80#ifndef QT_NO_DEBUG_STREAM
81QDebug operator<<(QDebug debug, const QIOSWindow *window);
82#endif
83
84QUIView *quiview_cast(UIView *view);
85
86QT_END_NAMESPACE
87
88#endif // QIOSWINDOW_H
bool openUrl(const QUrl &url)
bool openDocument(const QUrl &url)
bool handleUrl(const QUrl &url)
Combined button and popup list for selecting options.
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcEventDispatcher)
Q_DECLARE_LOGGING_CATEGORY(lcQpaWindowScene)
UIView * rootViewForScreen(const QPlatformScreen *)
UIWindow * presentationWindow(QWindow *)
Definition qiosglobal.mm:97
int infoPlistValue(NSString *key, int defaultValue)
Definition qiosglobal.mm:90
Qt::ScreenOrientation toQtScreenOrientation(UIDeviceOrientation uiDeviceOrientation)
Definition qiosglobal.mm:42
bool isQtApplication()
Definition qiosglobal.mm:21
bool isRunningOnVisionOS()
Definition qiosglobal.mm:32
Q_DECLARE_LOGGING_CATEGORY(lcQpaInputMethods)
UIDeviceOrientation fromQtScreenOrientation(Qt::ScreenOrientation qtOrientation)
Definition qiosglobal.mm:67
Q_DECLARE_LOGGING_CATEGORY(lcQpaWindow)
QDebug operator<<(QDebug debug, const QIOSWindow *window)
QUIView * quiview_cast(UIView *view)
Returns the view cast to a QUIview if possible.