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
qquickgraphicsinfo_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QQUICKGRAPHICSINFO_P_H
6#define QQUICKGRAPHICSINFO_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 <QtCore/qobject.h>
20#include <QtCore/qpointer.h>
21#include <QtQml/qqml.h>
22#include <QtGui/qsurfaceformat.h>
23#include <QtQuick/qsgrendererinterface.h>
24#include <QtCore/private/qglobal_p.h>
25
26QT_BEGIN_NAMESPACE
27
28class QQuickItem;
29class QQuickWindow;
30
32{
33 Q_OBJECT
34 Q_PROPERTY(GraphicsApi api READ api NOTIFY apiChanged FINAL)
38
43
46 QML_UNCREATABLE("GraphicsInfo is only available via attached properties.")
48
49public:
67 Q_ENUM(GraphicsApi)
68
75 Q_ENUM(ShaderType)
76
81 Q_ENUM(ShaderCompilationType)
82
88 Q_ENUM(ShaderSourceType)
89
95 Q_ENUM(OpenGLContextProfile)
96
102 Q_ENUM(RenderableType)
103
105 QQuickGraphicsInfo(QQuickWindow *window);
106
107 static QQuickGraphicsInfo *qmlAttachedProperties(QObject *object);
108
109 GraphicsApi api() const { return m_api; }
110 ShaderType shaderType() const { return m_shaderType; }
111 ShaderCompilationType shaderCompilationType() const { return m_shaderCompilationType; }
112 ShaderSourceType shaderSourceType() const { return m_shaderSourceType; }
113
114 int majorVersion() const { return m_majorVersion; }
115 int minorVersion() const { return m_minorVersion; }
116 OpenGLContextProfile profile() const { return m_profile; }
117 RenderableType renderableType() const { return m_renderableType; }
118
124
129
130private Q_SLOTS:
131 void updateInfo();
132 void setWindow(QQuickWindow *window);
133
134private:
135 QPointer<QQuickWindow> m_window;
136 GraphicsApi m_api = Unknown;
137 ShaderType m_shaderType = UnknownShadingLanguage;
138 ShaderCompilationType m_shaderCompilationType = ShaderCompilationType(0);
139 ShaderSourceType m_shaderSourceType = ShaderSourceType(0);
140 int m_majorVersion = 2;
141 int m_minorVersion = 0;
142 OpenGLContextProfile m_profile = OpenGLNoProfile;
143 RenderableType m_renderableType = SurfaceFormatUnspecified;
144};
145
146QT_END_NAMESPACE
147
148#endif // QQUICKGRAPHICSINFO_P_H
void minorVersionChanged()
GraphicsApi api() const
void renderableTypeChanged()
static QQuickGraphicsInfo * qmlAttachedProperties(QObject *object)
void shaderCompilationTypeChanged()
QQuickGraphicsInfo(QQuickWindow *window)
ShaderCompilationType shaderCompilationType() const
void majorVersionChanged()
OpenGLContextProfile profile() const
ShaderSourceType shaderSourceType() const
ShaderType shaderType() const
void shaderSourceTypeChanged()
RenderableType renderableType() const
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
\qmltype Window \nativetype QQuickWindow \inqmlmodule QtQuick
Combined button and popup list for selecting options.