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
qquickscreen_p.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 QQUICKSCREEN_P_H
6#define QQUICKSCREEN_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQml/qqml.h>
20#include <QtQuick/private/qtquickglobal_p.h>
21
22#include <QtCore/qpointer.h>
23#include <QtCore/qrect.h>
24
26
27
28class QQuickItem;
29class QQuickWindow;
30class QScreen;
31
32
33class Q_QUICK_EXPORT QQuickScreenInfo : public QObject
34{
35 Q_OBJECT
36 Q_PROPERTY(QString name READ name NOTIFY nameChanged FINAL)
37 Q_PROPERTY(QString manufacturer READ manufacturer NOTIFY manufacturerChanged REVISION(2, 10) FINAL)
38 Q_PROPERTY(QString model READ model NOTIFY modelChanged REVISION(2, 10) FINAL)
39 Q_PROPERTY(QString serialNumber READ serialNumber NOTIFY serialNumberChanged REVISION(2, 10) FINAL)
40 Q_PROPERTY(int width READ width NOTIFY widthChanged FINAL)
41 Q_PROPERTY(int height READ height NOTIFY heightChanged FINAL)
42 Q_PROPERTY(int desktopAvailableWidth READ desktopAvailableWidth NOTIFY desktopGeometryChanged FINAL)
43 Q_PROPERTY(int desktopAvailableHeight READ desktopAvailableHeight NOTIFY desktopGeometryChanged FINAL)
44 Q_PROPERTY(qreal logicalPixelDensity READ logicalPixelDensity NOTIFY logicalPixelDensityChanged FINAL)
45 Q_PROPERTY(qreal pixelDensity READ pixelDensity NOTIFY pixelDensityChanged FINAL)
46 Q_PROPERTY(qreal devicePixelRatio READ devicePixelRatio NOTIFY devicePixelRatioChanged FINAL)
47 Q_PROPERTY(Qt::ScreenOrientation primaryOrientation READ primaryOrientation NOTIFY primaryOrientationChanged FINAL)
48 Q_PROPERTY(Qt::ScreenOrientation orientation READ orientation NOTIFY orientationChanged FINAL)
49
50 Q_PROPERTY(int virtualX READ virtualX NOTIFY virtualXChanged REVISION(2, 3) FINAL)
51 Q_PROPERTY(int virtualY READ virtualY NOTIFY virtualYChanged REVISION(2, 3) FINAL)
52
53 Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged REVISION(6, 13) FINAL)
54 Q_PROPERTY(QRect availableGeometry READ availableGeometry NOTIFY availableGeometryChanged REVISION(6, 13) FINAL)
55 Q_PROPERTY(QRect desktopGeometry READ desktopGeometry NOTIFY desktopGeometryChanged REVISION(6, 13) FINAL)
56 Q_PROPERTY(QRect availableDesktopGeometry READ availableDesktopGeometry NOTIFY availableDesktopGeometryChanged REVISION(6, 13) FINAL)
57
58 QML_NAMED_ELEMENT(ScreenInfo)
59 QML_ADDED_IN_VERSION(2, 3)
60 QML_UNCREATABLE("ScreenInfo can only be used via the attached property, or by retrieving it from Application's screens property.")
61
62public:
63 QQuickScreenInfo(QObject *parent = nullptr, QScreen *wrappedScreen = nullptr);
64
65 QString name() const;
66 QString manufacturer() const;
67 QString model() const;
68 QString serialNumber() const;
69 int width() const;
70 int height() const;
71 int desktopAvailableWidth() const;
72 int desktopAvailableHeight() const;
73 qreal logicalPixelDensity() const;
74 qreal pixelDensity() const;
75 qreal devicePixelRatio() const;
76 Qt::ScreenOrientation primaryOrientation() const;
77 Qt::ScreenOrientation orientation() const;
78 int virtualX() const;
79 int virtualY() const;
80 QRect geometry() const;
81 QRect availableGeometry() const;
82 QRect desktopGeometry() const;
83 QRect availableDesktopGeometry() const;
84
85 void setWrappedScreen(QScreen *screen);
86 QScreen *wrappedScreen() const;
87
88Q_SIGNALS:
89 void nameChanged();
90 Q_REVISION(2, 10) void manufacturerChanged();
91 Q_REVISION(2, 10) void modelChanged();
92 Q_REVISION(2, 10) void serialNumberChanged();
93 void widthChanged();
94 void heightChanged();
95 void desktopGeometryChanged();
96 void logicalPixelDensityChanged();
97 void pixelDensityChanged();
98 void devicePixelRatioChanged();
99 void primaryOrientationChanged();
100 void orientationChanged();
101 Q_REVISION(2, 3) void virtualXChanged();
102 Q_REVISION(2, 3) void virtualYChanged();
103 Q_REVISION(6, 13) void geometryChanged();
104 Q_REVISION(6, 13) void availableGeometryChanged();
105 Q_REVISION(6, 13) void availableDesktopGeometryChanged();
106
107protected:
108 QPointer<QScreen> m_screen;
109};
110
111class Q_QUICK_EXPORT QQuickScreenAttached : public QQuickScreenInfo
112{
113 Q_OBJECT
114
115 QML_ANONYMOUS
116 QML_ADDED_IN_VERSION(2, 0)
117
118public:
119 QQuickScreenAttached(QObject* attachee);
120
121 //Treats int as Qt::ScreenOrientation, due to QTBUG-20639
122 Q_INVOKABLE int angleBetween(int a, int b);
123
124 void windowChanged(QQuickWindow*);
125
126protected Q_SLOTS:
127 void screenChanged(QScreen*);
128
129private:
130 QQuickWindow* m_window = nullptr;
131 QQuickItem* m_attachee;
132};
133
134class Q_QUICK_EXPORT QQuickScreen : public QObject
135{
136 Q_OBJECT
137 QML_ATTACHED(QQuickScreenAttached)
138 QML_NAMED_ELEMENT(Screen)
139 QML_ADDED_IN_VERSION(2, 0)
140 QML_UNCREATABLE("Screen can only be used via the attached property.")
141
142public:
143 static QQuickScreenAttached *qmlAttachedProperties(QObject *object){ return new QQuickScreenAttached(object); }
144};
145
146QT_END_NAMESPACE
147
148#endif
The QQuickRenderControl class provides a mechanism for rendering the Qt Quick scenegraph onto an offs...
Combined button and popup list for selecting options.
Definition qjsvalue.h:24
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")
QDebug operator<<(QDebug dbg, const QFileInfo &fi)
#define PRINT_LISTENERS()
QDebug operator<<(QDebug debug, const QQuickItem *item)
static bool itemZOrder_sort(QQuickItem *lhs, QQuickItem *rhs)
#define DIRTY_TO_STRING(value)
void debugFocusTree(QQuickItem *item, QQuickItem *scope=nullptr, int depth=1)
DEFINE_OBJECT_VTABLE(QQuickItemWrapper)
const SigMap sigMap[]
static void setActiveFocus(QQuickItem *item, Qt::FocusReason reason)
static void markObjects(QV4::Heap::Base *that, QV4::MarkStack *markStack)
const char * sig