Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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, WId nativeHandle = 0);
26
27 void setGeometry(const QRect &rect) override;
28
29 void setWindowState(Qt::WindowStates state) override;
30 void setParent(const QPlatformWindow *window) override;
31 void setVisible(bool visible) override;
32 void setOpacity(qreal level) override;
33
34 bool isExposed() const override;
35 void propagateSizeHints() override {}
36
37 QMargins safeAreaMargins() const override;
38
39 void raise() override{ raiseOrLower(true); }
40 void lower() override { raiseOrLower(false); }
41
42 bool shouldAutoActivateWindow() const;
43 void requestActivateWindow() override;
44
45 qreal devicePixelRatio() const override;
46
47 bool setMouseGrabEnabled(bool grab) override { return grab; }
48 bool setKeyboardGrabEnabled(bool grab) override { return grab; }
49
50 WId winId() const override { return WId(m_view); }
51
53
54 QSurfaceFormat format() const override;
55
56 void requestUpdate() override;
57
58 void setMask(const QRegion &region) override;
59
60#if QT_CONFIG(opengl)
61 CAEAGLLayer *eaglLayer() const;
62#endif
63
64 bool isForeignWindow() const override;
65 UIView *view() const;
66
67private:
68 void applicationStateChanged(Qt::ApplicationState state);
69 void applyGeometry(const QRect &rect);
70
71 UIView *m_view;
72
73 QRect m_normalGeometry;
74 int m_windowLevel;
75
76 void raiseOrLower(bool raise);
77 void updateWindowLevel();
78 bool blockedByModal();
79
80 friend class QIOSScreen;
81};
82
83#ifndef QT_NO_DEBUG_STREAM
85#endif
86
88
90
91#endif // QIOSWINDOW_H
\inmodule QtCore
bool isForeignWindow() const override
bool shouldAutoActivateWindow() const
void propagateSizeHints() override
Reimplement to propagate the size hints of the QWindow.
Definition qioswindow.h:35
UIView * view() const
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:47
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 setMask(const QRegion &region) override
Reimplement to be able to let Qt set the mask of a window.
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:48
QIOSWindow(QWindow *window, WId nativeHandle=0)
Definition qioswindow.mm:37
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:50
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:40
void raise() override
Reimplement to be able to let Qt raise windows to the top of the desktop.
Definition qioswindow.h:39
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.
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.
\inmodule QtCore
Definition qmargins.h:24
\inmodule QtCore
Definition qobject.h:103
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 QRegion class specifies a clip region for a painter.
Definition qregion.h:27
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.
ApplicationState
Definition qnamespace.h:262
QDebug operator<<(QDebug debug, const QIOSWindow *window)
QUIView * quiview_cast(UIView *view)
Returns the view cast to a QUIview if possible.
GLenum GLuint GLint level
#define QT_MANGLE_NAMESPACE(name)
#define Q_OBJECT
double qreal
Definition qtypes.h:187
aWidget window() -> setWindowTitle("New Window Title")
[2]
QQuickView * view
[0]