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
qiosscreen.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 QIOSSCREEN_H
6#define QIOSSCREEN_H
7
8#include <UIKit/UIKit.h>
9
10#include <qpa/qplatformscreen.h>
11
12#include <QtCore/private/qcore_mac_p.h>
13
14@class QIOSOrientationListener;
15
16QT_BEGIN_NAMESPACE
17
18class QIOSScreen : public QObject, public QPlatformScreen
19{
20 Q_OBJECT
21
22public:
23#if !defined(Q_OS_VISIONOS)
24 QIOSScreen(UIScreen *screen);
25#else
26 QIOSScreen();
27#endif
28 ~QIOSScreen();
29
30 QString name() const override;
31
32 QRect geometry() const override;
33 QRect availableGeometry() const override;
34 int depth() const override;
35 QImage::Format format() const override;
36 QSizeF physicalSize() const override;
37 QDpi logicalBaseDpi() const override;
38 qreal devicePixelRatio() const override;
39 qreal refreshRate() const override;
40
41 Qt::ScreenOrientation nativeOrientation() const override;
42 Qt::ScreenOrientation orientation() const override;
43
44 QPixmap grabWindow(WId window, int x, int y, int width, int height) const override;
45
46#if !defined(Q_OS_VISIONOS)
47 UIScreen *uiScreen() const;
48#endif
49
50 void setUpdatesPaused(bool);
51
52 void updateProperties();
53
54private:
55 static void initializeScreens();
56 void deliverUpdateRequests() const;
57
58#if !defined(Q_OS_VISIONOS)
59 UIScreen *m_uiScreen = nullptr;
60 QMacNotificationObserver m_screenBrightnessObserver;
61#endif
62 QRect m_geometry;
63 QRect m_availableGeometry;
64 int m_depth;
65#if !defined(Q_OS_VISIONOS)
66 uint m_physicalDpi;
67#endif
68 QSizeF m_physicalSize;
69 CADisplayLink *m_displayLink = nullptr;
70
71 friend class QIOSIntegration;
72};
73
74QT_END_NAMESPACE
75
76#endif
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)