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
13class QIOSContext;
14class QIOSWindow;
15
16@class QUIView;
17
18QT_BEGIN_NAMESPACE
19
20class QIOSWindow : public QObject, public QPlatformWindow
21{
22 Q_OBJECT
23
24public:
25 explicit QIOSWindow(QWindow *window, WId nativeHandle = 0);
26 ~QIOSWindow();
27
28 void setGeometry(const QRect &rect) override;
29
30 void setWindowState(Qt::WindowStates state) override;
31 void setParent(const QPlatformWindow *window) override;
32 void setVisible(bool visible) override;
33 void setOpacity(qreal level) override;
34
35 bool isExposed() const override;
36 void propagateSizeHints() override {}
37
38 QMargins safeAreaMargins() const override;
39
40 void raise() override{ raiseOrLower(true); }
41 void lower() override { raiseOrLower(false); }
42
43 bool shouldAutoActivateWindow() const;
44 void requestActivateWindow() override;
45
46 qreal devicePixelRatio() const override;
47
48 bool setMouseGrabEnabled(bool grab) override { return grab; }
49 bool setKeyboardGrabEnabled(bool grab) override { return grab; }
50
51 WId winId() const override { return WId(m_view); }
52
53 void clearAccessibleCache();
54
55 QSurfaceFormat format() const override;
56
57 void requestUpdate() override;
58
59 void setMask(const QRegion &region) override;
60
61#if QT_CONFIG(opengl)
62 CAEAGLLayer *eaglLayer() const;
63#endif
64
65 bool isForeignWindow() const override;
66 UIView *view() const;
67
68private:
69 void applicationStateChanged(Qt::ApplicationState state);
70 void applyGeometry(const QRect &rect);
71
72 UIView *m_view;
73
74 QRect m_normalGeometry;
75
76 void raiseOrLower(bool raise);
77 int windowLevel() const;
78 bool blockedByModal();
79
80 friend class QIOSScreen;
81};
82
83#ifndef QT_NO_DEBUG_STREAM
84QDebug operator<<(QDebug debug, const QIOSWindow *window);
85#endif
86
87QT_MANGLE_NAMESPACE(QUIView) *quiview_cast(UIView *view);
88
89QT_END_NAMESPACE
90
91#endif // QIOSWINDOW_H
bool openUrl(const QUrl &url)
bool openDocument(const QUrl &url)
bool handleUrl(const QUrl &url)
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)
QT_MANGLE_NAMESPACE(QUIView) *quiview_cast(UIView *view)