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
25
26
27class QQuickItem;
28class QQuickWindow;
29class QScreen;
30
31
32class Q_QUICK_EXPORT QQuickScreenInfo : public QObject
33{
34 Q_OBJECT
35 Q_PROPERTY(QString name READ name NOTIFY nameChanged FINAL)
36 Q_PROPERTY(QString manufacturer READ manufacturer NOTIFY manufacturerChanged REVISION(2, 10) FINAL)
37 Q_PROPERTY(QString model READ model NOTIFY modelChanged REVISION(2, 10) FINAL)
38 Q_PROPERTY(QString serialNumber READ serialNumber NOTIFY serialNumberChanged REVISION(2, 10) FINAL)
39 Q_PROPERTY(int width READ width NOTIFY widthChanged FINAL)
40 Q_PROPERTY(int height READ height NOTIFY heightChanged FINAL)
41 Q_PROPERTY(int desktopAvailableWidth READ desktopAvailableWidth NOTIFY desktopGeometryChanged FINAL)
42 Q_PROPERTY(int desktopAvailableHeight READ desktopAvailableHeight NOTIFY desktopGeometryChanged FINAL)
43 Q_PROPERTY(qreal logicalPixelDensity READ logicalPixelDensity NOTIFY logicalPixelDensityChanged FINAL)
44 Q_PROPERTY(qreal pixelDensity READ pixelDensity NOTIFY pixelDensityChanged FINAL)
45 Q_PROPERTY(qreal devicePixelRatio READ devicePixelRatio NOTIFY devicePixelRatioChanged FINAL)
46 Q_PROPERTY(Qt::ScreenOrientation primaryOrientation READ primaryOrientation NOTIFY primaryOrientationChanged FINAL)
47 Q_PROPERTY(Qt::ScreenOrientation orientation READ orientation NOTIFY orientationChanged FINAL)
48
49 Q_PROPERTY(int virtualX READ virtualX NOTIFY virtualXChanged REVISION(2, 3) FINAL)
50 Q_PROPERTY(int virtualY READ virtualY NOTIFY virtualYChanged REVISION(2, 3) FINAL)
51 QML_NAMED_ELEMENT(ScreenInfo)
52 QML_ADDED_IN_VERSION(2, 3)
53 QML_UNCREATABLE("ScreenInfo can only be used via the attached property.")
54
55public:
56 QQuickScreenInfo(QObject *parent = nullptr, QScreen *wrappedScreen = nullptr);
57
58 QString name() const;
59 QString manufacturer() const;
60 QString model() const;
61 QString serialNumber() const;
62 int width() const;
63 int height() const;
64 int desktopAvailableWidth() const;
65 int desktopAvailableHeight() const;
66 qreal logicalPixelDensity() const;
67 qreal pixelDensity() const;
68 qreal devicePixelRatio() const;
69 Qt::ScreenOrientation primaryOrientation() const;
70 Qt::ScreenOrientation orientation() const;
71 int virtualX() const;
72 int virtualY() const;
73
74 void setWrappedScreen(QScreen *screen);
75 QScreen *wrappedScreen() const;
76
77Q_SIGNALS:
78 void nameChanged();
79 Q_REVISION(2, 10) void manufacturerChanged();
80 Q_REVISION(2, 10) void modelChanged();
81 Q_REVISION(2, 10) void serialNumberChanged();
82 void widthChanged();
83 void heightChanged();
84 void desktopGeometryChanged();
85 void logicalPixelDensityChanged();
86 void pixelDensityChanged();
87 void devicePixelRatioChanged();
88 void primaryOrientationChanged();
89 void orientationChanged();
90 Q_REVISION(2, 3) void virtualXChanged();
91 Q_REVISION(2, 3) void virtualYChanged();
92
93protected:
94 QPointer<QScreen> m_screen;
95};
96
97class Q_QUICK_EXPORT QQuickScreenAttached : public QQuickScreenInfo
98{
99 Q_OBJECT
100
101 QML_ANONYMOUS
102 QML_ADDED_IN_VERSION(2, 0)
103
104public:
105 QQuickScreenAttached(QObject* attachee);
106
107 //Treats int as Qt::ScreenOrientation, due to QTBUG-20639
108 Q_INVOKABLE int angleBetween(int a, int b);
109
110 void windowChanged(QQuickWindow*);
111
112protected Q_SLOTS:
113 void screenChanged(QScreen*);
114
115private:
116 QQuickWindow* m_window = nullptr;
117 QQuickItem* m_attachee;
118};
119
120class Q_QUICK_EXPORT QQuickScreen : public QObject
121{
122 Q_OBJECT
123 QML_ATTACHED(QQuickScreenAttached)
124 QML_NAMED_ELEMENT(Screen)
125 QML_ADDED_IN_VERSION(2, 0)
126 QML_UNCREATABLE("Screen can only be used via the attached property.")
127
128public:
129 static QQuickScreenAttached *qmlAttachedProperties(QObject *object){ return new QQuickScreenAttached(object); }
130};
131
132QT_END_NAMESPACE
133
134#endif
The QQuickRenderControl class provides a mechanism for rendering the Qt Quick scenegraph onto an offs...
Definition qjsvalue.h:23
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