Qt 6.x
The Qt SDK
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
4#ifndef QIOSWINDOW_H
5#define QIOSWINDOW_H
6
7#include <qpa/qplatformwindow.h>
8#include <qpa/qwindowsysteminterface.h>
9
10#import <UIKit/UIKit.h>
11
12class QIOSContext;
13class QIOSWindow;
14
15@class QUIView;
16
18
19class QIOSWindow : public QObject, public QPlatformWindow
20{
22
23public:
24 explicit QIOSWindow(QWindow *window);
26
27 void setGeometry(const QRect &rect) override;
28
29 void setWindowState(Qt::WindowStates state) override;
30 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
54
55 QSurfaceFormat format() const override;
56
57 void requestUpdate() override;
58
59#if QT_CONFIG(opengl)
60 CAEAGLLayer *eaglLayer() const;
61#endif
62
63private:
64 void applicationStateChanged(Qt::ApplicationState state);
65 void applyGeometry(const QRect &rect);
66
67 QUIView *m_view;
68
69 QRect m_normalGeometry;
70 int m_windowLevel;
71
72 void raiseOrLower(bool raise);
73 void updateWindowLevel();
74 bool blockedByModal();
75
76 friend class QIOSScreen;
77};
78
79#ifndef QT_NO_DEBUG_STREAM
81#endif
82
84
85#endif // QIOSWINDOW_H
\inmodule QtCore
bool shouldAutoActivateWindow() const
void propagateSizeHints() override
Reimplement to propagate the size hints of the QWindow.
Definition qioswindow.h:36
void handleContentOrientationChange(Qt::ScreenOrientation orientation) override
Handle changes to the orientation of the platform window's contents.
void setParent(const QPlatformWindow *window) override
This function is called to enable native child window in QPA.
void clearAccessibleCache()
bool setMouseGrabEnabled(bool grab) override
Definition qioswindow.h:48
void setWindowState(Qt::WindowStates state) override
Requests setting the window state of this surface to type.
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
void requestUpdate() override
Requests an QEvent::UpdateRequest event.
void setOpacity(qreal level) override
Reimplement to be able to let Qt set the opacity level of a window.
bool setKeyboardGrabEnabled(bool grab) override
Definition qioswindow.h:49
qreal devicePixelRatio() const override
Reimplement this function in subclass to return the device pixel ratio for the window.
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
Definition qioswindow.h:51
bool isExposed() const override
Returns if this window is exposed in the windowing system.
void lower() override
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
Definition qioswindow.h:41
void raise() override
Reimplement to be able to let Qt raise windows to the top of the desktop.
Definition qioswindow.h:40
QMargins safeAreaMargins() const override
The safe area margins of a window represent the area that is safe to place content within,...
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
Definition qioswindow.mm:97
void requestActivateWindow() override
Reimplement to let Qt be able to request activation/focus for a window.
QSurfaceFormat format() const override
Returns the actual surface format of the window.
Definition qioswindow.mm:85
\inmodule QtCore
Definition qmargins.h:23
\inmodule QtCore
Definition qobject.h:90
The QPlatformWindow class provides an abstraction for top-level windows.
QWindow * window() const
Returns the window which belongs to the QPlatformWindow.
\inmodule QtCore\reentrant
Definition qrect.h:30
The QSurfaceFormat class represents the format of a QSurface. \inmodule QtGui.
\inmodule QtGui
Definition qwindow.h:63
rect
[4]
else opt state
[0]
Combined button and popup list for selecting options.
ScreenOrientation
Definition qnamespace.h:270
ApplicationState
Definition qnamespace.h:261
QDebug operator<<(QDebug debug, const QIOSWindow *window)
GLenum GLuint GLint level
#define Q_OBJECT
double qreal
Definition qtypes.h:92
aWidget window() -> setWindowTitle("New Window Title")
[2]