6#include <private/qquickitem_p.h>
7#include <qopenglcontext.h>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
32 , m_shaderType(UnknownShadingLanguage)
33 , m_shaderCompilationType(ShaderCompilationType(0))
34 , m_shaderSourceType(ShaderSourceType(0))
37 , m_profile(OpenGLNoProfile)
38 , m_renderableType(SurfaceFormatUnspecified)
41 connect(item, &QQuickItem::windowChanged,
this, &QQuickGraphicsInfo::setWindow);
42 setWindow(item->window());
48 if (QQuickItem *item = qobject_cast<QQuickItem *>(object))
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
151
152
153
154
155
156
157
158
159
160
163
164
165
166
167
168
169
170
171
172
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
214 QSGRendererInterface *rif = m_window->rendererInterface();
216 GraphicsApi newAPI = GraphicsApi(rif->graphicsApi());
217 if (m_api != newAPI) {
220 m_shaderType = ShaderType(rif->shaderType());
221 emit shaderTypeChanged();
222 m_shaderCompilationType = ShaderCompilationType(
int(rif->shaderCompilationType()));
223 emit shaderCompilationTypeChanged();
224 m_shaderSourceType = ShaderSourceType(
int(rif->shaderSourceType()));
225 emit shaderSourceTypeChanged();
230 QSurfaceFormat format = QSurfaceFormat::defaultFormat();
232 if (m_window && m_window->isSceneGraphInitialized()) {
233 QOpenGLContext *context = QQuickWindowPrivate::get(m_window)->openglContext();
235 format = context->format();
238 if (m_majorVersion != format.majorVersion()) {
239 m_majorVersion = format.majorVersion();
240 emit majorVersionChanged();
242 if (m_minorVersion != format.minorVersion()) {
243 m_minorVersion = format.minorVersion();
244 emit minorVersionChanged();
246 OpenGLContextProfile profile =
static_cast<OpenGLContextProfile>(format.profile());
247 if (m_profile != profile) {
249 emit profileChanged();
251 RenderableType renderableType =
static_cast<RenderableType>(format.renderableType());
252 if (m_renderableType != renderableType) {
253 m_renderableType = renderableType;
254 emit renderableTypeChanged();
260 if (m_window != window) {
262 disconnect(m_window, SIGNAL(sceneGraphInitialized()),
this, SLOT(updateInfo()));
263 disconnect(m_window, SIGNAL(sceneGraphInvalidated()),
this, SLOT(updateInfo()));
266 connect(window, SIGNAL(sceneGraphInitialized()),
this, SLOT(updateInfo()));
267 connect(window, SIGNAL(sceneGraphInvalidated()),
this, SLOT(updateInfo()));
276#include "moc_qquickgraphicsinfo_p.cpp"
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.