5#include <private/qquickitem_p.h>
6#include <qopenglcontext.h>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
31 , m_shaderType(UnknownShadingLanguage)
32 , m_shaderCompilationType(ShaderCompilationType(0))
33 , m_shaderSourceType(ShaderSourceType(0))
36 , m_profile(OpenGLNoProfile)
37 , m_renderableType(SurfaceFormatUnspecified)
40 connect(item, &QQuickItem::windowChanged,
this, &QQuickGraphicsInfo::setWindow);
41 setWindow(item->window());
47 if (QQuickItem *item = qobject_cast<QQuickItem *>(object))
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
121
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
150
151
152
153
154
155
156
157
158
159
162
163
164
165
166
167
168
169
170
171
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
213 QSGRendererInterface *rif = m_window->rendererInterface();
215 GraphicsApi newAPI = GraphicsApi(rif->graphicsApi());
216 if (m_api != newAPI) {
219 m_shaderType = ShaderType(rif->shaderType());
220 emit shaderTypeChanged();
221 m_shaderCompilationType = ShaderCompilationType(
int(rif->shaderCompilationType()));
222 emit shaderCompilationTypeChanged();
223 m_shaderSourceType = ShaderSourceType(
int(rif->shaderSourceType()));
224 emit shaderSourceTypeChanged();
229 QSurfaceFormat format = QSurfaceFormat::defaultFormat();
231 if (m_window && m_window->isSceneGraphInitialized()) {
232 QOpenGLContext *context = QQuickWindowPrivate::get(m_window)->openglContext();
234 format = context->format();
237 if (m_majorVersion != format.majorVersion()) {
238 m_majorVersion = format.majorVersion();
239 emit majorVersionChanged();
241 if (m_minorVersion != format.minorVersion()) {
242 m_minorVersion = format.minorVersion();
243 emit minorVersionChanged();
245 OpenGLContextProfile profile =
static_cast<OpenGLContextProfile>(format.profile());
246 if (m_profile != profile) {
248 emit profileChanged();
250 RenderableType renderableType =
static_cast<RenderableType>(format.renderableType());
251 if (m_renderableType != renderableType) {
252 m_renderableType = renderableType;
253 emit renderableTypeChanged();
259 if (m_window != window) {
261 disconnect(m_window, SIGNAL(sceneGraphInitialized()),
this, SLOT(updateInfo()));
262 disconnect(m_window, SIGNAL(sceneGraphInvalidated()),
this, SLOT(updateInfo()));
265 connect(window, SIGNAL(sceneGraphInitialized()),
this, SLOT(updateInfo()));
266 connect(window, SIGNAL(sceneGraphInvalidated()),
this, SLOT(updateInfo()));
275#include "moc_qquickgraphicsinfo_p.cpp"
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Combined button and popup list for selecting options.