Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
21#include <QtCore/qpointer.h>
22
24
25
26class QQuickItem;
27class QQuickWindow;
28class QScreen;
29
30
31class Q_QUICK_EXPORT QQuickScreenInfo : public QObject
32{
34 Q_PROPERTY(QString name READ name NOTIFY nameChanged FINAL)
35 Q_PROPERTY(QString manufacturer READ manufacturer NOTIFY manufacturerChanged REVISION(2, 10) FINAL)
36 Q_PROPERTY(QString model READ model NOTIFY modelChanged REVISION(2, 10) FINAL)
37 Q_PROPERTY(QString serialNumber READ serialNumber NOTIFY serialNumberChanged REVISION(2, 10) FINAL)
38 Q_PROPERTY(int width READ width NOTIFY widthChanged FINAL)
39 Q_PROPERTY(int height READ height NOTIFY heightChanged FINAL)
40 Q_PROPERTY(int desktopAvailableWidth READ desktopAvailableWidth NOTIFY desktopGeometryChanged FINAL)
41 Q_PROPERTY(int desktopAvailableHeight READ desktopAvailableHeight NOTIFY desktopGeometryChanged FINAL)
42 Q_PROPERTY(qreal logicalPixelDensity READ logicalPixelDensity NOTIFY logicalPixelDensityChanged FINAL)
43 Q_PROPERTY(qreal pixelDensity READ pixelDensity NOTIFY pixelDensityChanged FINAL)
44 Q_PROPERTY(qreal devicePixelRatio READ devicePixelRatio NOTIFY devicePixelRatioChanged FINAL)
45 Q_PROPERTY(Qt::ScreenOrientation primaryOrientation READ primaryOrientation NOTIFY primaryOrientationChanged FINAL)
46 Q_PROPERTY(Qt::ScreenOrientation orientation READ orientation NOTIFY orientationChanged FINAL)
47
48 Q_PROPERTY(int virtualX READ virtualX NOTIFY virtualXChanged REVISION(2, 3) FINAL)
49 Q_PROPERTY(int virtualY READ virtualY NOTIFY virtualYChanged REVISION(2, 3) FINAL)
50 QML_NAMED_ELEMENT(ScreenInfo)
52 QML_UNCREATABLE("ScreenInfo can only be used via the attached property.")
53
54public:
55 QQuickScreenInfo(QObject *parent = nullptr, QScreen *wrappedScreen = nullptr);
56
57 QString name() const;
58 QString manufacturer() const;
59 QString model() const;
60 QString serialNumber() const;
61 int width() const;
62 int height() const;
63 int desktopAvailableWidth() const;
64 int desktopAvailableHeight() const;
65 qreal logicalPixelDensity() const;
66 qreal pixelDensity() const;
67 qreal devicePixelRatio() const;
68 Qt::ScreenOrientation primaryOrientation() const;
69 Qt::ScreenOrientation orientation() const;
70 int virtualX() const;
71 int virtualY() const;
72
73 void setWrappedScreen(QScreen *screen);
74 QScreen *wrappedScreen() const;
75
77 void nameChanged();
78 Q_REVISION(2, 10) void manufacturerChanged();
79 Q_REVISION(2, 10) void modelChanged();
80 Q_REVISION(2, 10) void serialNumberChanged();
81 void widthChanged();
82 void heightChanged();
83 void desktopGeometryChanged();
84 void logicalPixelDensityChanged();
85 void pixelDensityChanged();
86 void devicePixelRatioChanged();
87 void primaryOrientationChanged();
88 void orientationChanged();
89 Q_REVISION(2, 3) void virtualXChanged();
90 Q_REVISION(2, 3) void virtualYChanged();
91
92protected:
93 QPointer<QScreen> m_screen;
94};
95
96class Q_QUICK_EXPORT QQuickScreenAttached : public QQuickScreenInfo
97{
99
102
103public:
104 QQuickScreenAttached(QObject* attachee);
105
106 //Treats int as Qt::ScreenOrientation, due to QTBUG-20639
107 Q_INVOKABLE int angleBetween(int a, int b);
108
109 void windowChanged(QQuickWindow*);
110
111protected Q_SLOTS:
112 void screenChanged(QScreen*);
113
114private:
115 QQuickWindow* m_window = nullptr;
116 QQuickItem* m_attachee;
117};
118
119class Q_QUICK_EXPORT QQuickScreen : public QObject
120{
123 QML_NAMED_ELEMENT(Screen)
125 QML_UNCREATABLE("Screen can only be used via the attached property.")
126
127public:
129};
130
132
133#endif
\inmodule QtCore
Definition qobject.h:103
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
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:129
Combined button and popup list for selecting options.
Definition qcompare.h:63
GLboolean GLboolean GLboolean b
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLint GLsizei width
GLuint name
#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:187
const char property[13]
Definition qwizard.cpp:101
QSqlQueryModel * model
[16]