Qt 6.x
The Qt SDK
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
4#ifndef QQUICKSCREEN_P_H
5#define QQUICKSCREEN_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQml/qqml.h>
19#include <QtQuick/private/qtquickglobal_p.h>
20
22
23
24class QQuickItem;
25class QQuickWindow;
26class QScreen;
27
28
29class Q_QUICK_PRIVATE_EXPORT QQuickScreenInfo : public QObject
30{
32 Q_PROPERTY(QString name READ name NOTIFY nameChanged FINAL)
33 Q_PROPERTY(QString manufacturer READ manufacturer NOTIFY manufacturerChanged REVISION(2, 10) FINAL)
34 Q_PROPERTY(QString model READ model NOTIFY modelChanged REVISION(2, 10) FINAL)
35 Q_PROPERTY(QString serialNumber READ serialNumber NOTIFY serialNumberChanged REVISION(2, 10) FINAL)
36 Q_PROPERTY(int width READ width NOTIFY widthChanged FINAL)
37 Q_PROPERTY(int height READ height NOTIFY heightChanged FINAL)
38 Q_PROPERTY(int desktopAvailableWidth READ desktopAvailableWidth NOTIFY desktopGeometryChanged FINAL)
39 Q_PROPERTY(int desktopAvailableHeight READ desktopAvailableHeight NOTIFY desktopGeometryChanged FINAL)
40 Q_PROPERTY(qreal logicalPixelDensity READ logicalPixelDensity NOTIFY logicalPixelDensityChanged FINAL)
41 Q_PROPERTY(qreal pixelDensity READ pixelDensity NOTIFY pixelDensityChanged FINAL)
42 Q_PROPERTY(qreal devicePixelRatio READ devicePixelRatio NOTIFY devicePixelRatioChanged FINAL)
43 Q_PROPERTY(Qt::ScreenOrientation primaryOrientation READ primaryOrientation NOTIFY primaryOrientationChanged FINAL)
44 Q_PROPERTY(Qt::ScreenOrientation orientation READ orientation NOTIFY orientationChanged FINAL)
45
46 Q_PROPERTY(int virtualX READ virtualX NOTIFY virtualXChanged REVISION(2, 3) FINAL)
47 Q_PROPERTY(int virtualY READ virtualY NOTIFY virtualYChanged REVISION(2, 3) FINAL)
48 QML_NAMED_ELEMENT(ScreenInfo)
50 QML_UNCREATABLE("ScreenInfo can only be used via the attached property.")
51
52public:
53 QQuickScreenInfo(QObject *parent = nullptr, QScreen *wrappedScreen = nullptr);
54
55 QString name() const;
56 QString manufacturer() const;
57 QString model() const;
58 QString serialNumber() const;
59 int width() const;
60 int height() const;
61 int desktopAvailableWidth() const;
62 int desktopAvailableHeight() const;
63 qreal logicalPixelDensity() const;
64 qreal pixelDensity() const;
65 qreal devicePixelRatio() const;
66 Qt::ScreenOrientation primaryOrientation() const;
67 Qt::ScreenOrientation orientation() const;
68 int virtualX() const;
69 int virtualY() const;
70
71 void setWrappedScreen(QScreen *screen);
72 QScreen *wrappedScreen() const;
73
75 void nameChanged();
76 Q_REVISION(2, 10) void manufacturerChanged();
77 Q_REVISION(2, 10) void modelChanged();
78 Q_REVISION(2, 10) void serialNumberChanged();
79 void widthChanged();
80 void heightChanged();
81 void desktopGeometryChanged();
82 void logicalPixelDensityChanged();
83 void pixelDensityChanged();
84 void devicePixelRatioChanged();
85 void primaryOrientationChanged();
86 void orientationChanged();
87 Q_REVISION(2, 3) void virtualXChanged();
88 Q_REVISION(2, 3) void virtualYChanged();
89
90protected:
91 QPointer<QScreen> m_screen;
92};
93
94class Q_QUICK_PRIVATE_EXPORT QQuickScreenAttached : public QQuickScreenInfo
95{
97
100
101public:
102 QQuickScreenAttached(QObject* attachee);
103
104 //Treats int as Qt::ScreenOrientation, due to QTBUG-20639
105 Q_INVOKABLE int angleBetween(int a, int b);
106
107 void windowChanged(QQuickWindow*);
108
109protected Q_SLOTS:
110 void screenChanged(QScreen*);
111
112private:
113 QQuickWindow* m_window = nullptr;
114 QQuickItem* m_attachee;
115};
116
117class Q_QUICK_PRIVATE_EXPORT QQuickScreen : public QObject
118{
121 QML_NAMED_ELEMENT(Screen)
123 QML_UNCREATABLE("Screen can only be used via the attached property.")
124
125public:
127};
128
130
132
133#endif
\inmodule QtCore
Definition qobject.h:90
\inmodule QtCore
Definition qpointer.h:18
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
static QQuickScreenAttached * qmlAttachedProperties(QObject *object)
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
The QScreen class is used to query screen properties. \inmodule QtGui.
Definition qscreen.h:32
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
Combined button and popup list for selecting options.
GLboolean GLboolean GLboolean b
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLint GLsizei width
GLuint name
#define QML_DECLARE_TYPE(TYPE)
Definition qqml.h:19
#define QML_UNCREATABLE(REASON)
#define QML_ANONYMOUS
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define QML_ATTACHED(ATTACHED_TYPE)
QScreen * screen
[1]
Definition main.cpp:29
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_REVISION(...)
#define Q_INVOKABLE
#define Q_SLOTS
#define Q_SIGNALS
double qreal
Definition qtypes.h:92
const char property[13]
Definition qwizard.cpp:101
QSqlQueryModel * model
[16]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent