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
qscreen.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 QSCREEN_H
6#define QSCREEN_H
7
8#include <QtGui/qtguiglobal.h>
9#include <QtCore/QList>
10#include <QtCore/QObject>
11#include <QtCore/QRect>
12#include <QtCore/QSize>
13#include <QtCore/QSizeF>
14
15#include <QtGui/QTransform>
16
17#include <QtCore/qnamespace.h>
18#include <QtCore/qnativeinterface.h>
19
21
22
23class QPlatformScreen;
24class QScreenPrivate;
25class QWindow;
26class QRect;
27class QPixmap;
28#ifndef QT_NO_DEBUG_STREAM
29class QDebug;
30#endif
31
32class Q_GUI_EXPORT QScreen : public QObject
33{
34 Q_OBJECT
35 Q_DECLARE_PRIVATE(QScreen)
36
37 Q_PROPERTY(QString name READ name CONSTANT)
38 Q_PROPERTY(QString manufacturer READ manufacturer CONSTANT)
39 Q_PROPERTY(QString model READ model CONSTANT)
40 Q_PROPERTY(QString serialNumber READ serialNumber CONSTANT)
41 Q_PROPERTY(int depth READ depth CONSTANT)
42 Q_PROPERTY(QSize size READ size NOTIFY geometryChanged)
43 Q_PROPERTY(QSize availableSize READ availableSize NOTIFY availableGeometryChanged)
44 Q_PROPERTY(QSize virtualSize READ virtualSize NOTIFY virtualGeometryChanged)
45 Q_PROPERTY(QSize availableVirtualSize READ availableVirtualSize NOTIFY virtualGeometryChanged)
46 Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged)
47 Q_PROPERTY(QRect availableGeometry READ availableGeometry NOTIFY availableGeometryChanged)
48 Q_PROPERTY(QRect virtualGeometry READ virtualGeometry NOTIFY virtualGeometryChanged)
49 Q_PROPERTY(QRect availableVirtualGeometry READ availableVirtualGeometry
50 NOTIFY virtualGeometryChanged)
51 Q_PROPERTY(QSizeF physicalSize READ physicalSize NOTIFY physicalSizeChanged)
52 Q_PROPERTY(qreal physicalDotsPerInchX READ physicalDotsPerInchX
53 NOTIFY physicalDotsPerInchChanged)
54 Q_PROPERTY(qreal physicalDotsPerInchY READ physicalDotsPerInchY
55 NOTIFY physicalDotsPerInchChanged)
56 Q_PROPERTY(qreal physicalDotsPerInch READ physicalDotsPerInch NOTIFY physicalDotsPerInchChanged)
57 Q_PROPERTY(qreal logicalDotsPerInchX READ logicalDotsPerInchX NOTIFY logicalDotsPerInchChanged)
58 Q_PROPERTY(qreal logicalDotsPerInchY READ logicalDotsPerInchY NOTIFY logicalDotsPerInchChanged)
59 Q_PROPERTY(qreal logicalDotsPerInch READ logicalDotsPerInch NOTIFY logicalDotsPerInchChanged)
60 Q_PROPERTY(qreal devicePixelRatio READ devicePixelRatio NOTIFY physicalDotsPerInchChanged)
61 Q_PROPERTY(Qt::ScreenOrientation primaryOrientation READ primaryOrientation
62 NOTIFY primaryOrientationChanged)
63 Q_PROPERTY(Qt::ScreenOrientation orientation READ orientation NOTIFY orientationChanged)
64 Q_PROPERTY(Qt::ScreenOrientation nativeOrientation READ nativeOrientation)
65 Q_PROPERTY(qreal refreshRate READ refreshRate NOTIFY refreshRateChanged)
66
67public:
68 ~QScreen();
69 QPlatformScreen *handle() const;
70
71 QString name() const;
72
73 QString manufacturer() const;
74 QString model() const;
75 QString serialNumber() const;
76
77 int depth() const;
78
79 QSize size() const;
80 QRect geometry() const;
81
82 QSizeF physicalSize() const;
83
84 qreal physicalDotsPerInchX() const;
85 qreal physicalDotsPerInchY() const;
86 qreal physicalDotsPerInch() const;
87
88 qreal logicalDotsPerInchX() const;
89 qreal logicalDotsPerInchY() const;
90 qreal logicalDotsPerInch() const;
91
92 qreal devicePixelRatio() const;
93
94 QSize availableSize() const;
95 QRect availableGeometry() const;
96
97 QList<QScreen *> virtualSiblings() const;
98 QScreen *virtualSiblingAt(QPoint point);
99
100 QSize virtualSize() const;
101 QRect virtualGeometry() const;
102
103 QSize availableVirtualSize() const;
104 QRect availableVirtualGeometry() const;
105
106 Qt::ScreenOrientation primaryOrientation() const;
107 Qt::ScreenOrientation orientation() const;
108 Qt::ScreenOrientation nativeOrientation() const;
109
110 int angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b) const;
111 QTransform transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target) const;
112 QRect mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect) const;
113
114 bool isPortrait(Qt::ScreenOrientation orientation) const;
115 bool isLandscape(Qt::ScreenOrientation orientation) const;
116
117 QPixmap grabWindow(WId window = 0, int x = 0, int y = 0, int w = -1, int h = -1);
118
119 qreal refreshRate() const;
121 QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(QScreen)
123Q_SIGNALS:
124 void geometryChanged(const QRect &geometry);
125 void availableGeometryChanged(const QRect &geometry);
126 void physicalSizeChanged(const QSizeF &size);
127 void physicalDotsPerInchChanged(qreal dpi);
128 void logicalDotsPerInchChanged(qreal dpi);
129 void virtualGeometryChanged(const QRect &rect);
130 void primaryOrientationChanged(Qt::ScreenOrientation orientation);
131 void orientationChanged(Qt::ScreenOrientation orientation);
132 void refreshRateChanged(qreal refreshRate);
133
134private:
135 explicit QScreen(QPlatformScreen *screen);
137 Q_DISABLE_COPY(QScreen)
138 friend class QGuiApplicationPrivate;
139 friend class QPlatformIntegration;
140 friend class QPlatformScreen;
141 friend class QHighDpiScaling;
142 friend class QWindowSystemInterface;
143};
144
145#ifndef QT_NO_DEBUG_STREAM
146Q_GUI_EXPORT QDebug operator<<(QDebug, const QScreen *);
147#endif
148
149QT_END_NAMESPACE
150
151#include <QtGui/qscreen_platform.h>
152
153#endif // QSCREEN_H
\inmodule QtGui
Definition qbitmap.h:16
The QColorTransform class is a transformation between color spaces.
\inmodule QtCore\reentrant
Definition qdatastream.h:50
\inmodule QtGui
Definition qimage.h:37
The QScreen class is used to query screen properties. \inmodule QtGui.
Definition qscreen.h:33
Combined button and popup list for selecting options.
static QBitmap makeBitmap(QImage &&image, Qt::ImageConversionFlags flags)
Definition qbitmap.cpp:142
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2582
void(* QImageCleanupFunction)(void *)
Definition qimage.h:34