11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
56
57
58
59
60
61
62
63
64
65
66
69
70
71
72
73
74
75
76
77
78
79
80
83
84
85
86
87
88
89
90
93
94
95
96
97
98
99
100
103
104
105
106
107
108
109
110
113
114
115
116
117
118
119
120
121
122
125
126
127
128
129
130
131
132
135
136
137
138
139
140
141
142
145
146
147
148
149
150
151
152
153
154
155
156
157
160
161
162
163
164
165
166
167
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
187
188
189
190
191
192
193
194
197
198
199
200
201
202
203
204
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
225
226
227
228
229
230
231
232
235
236
237
238
239
240
241
242
243
244
247
248
249
250
251
252
253
254
255
256
259
260
261
262
263
264
265
266
267
268
269
270
271
274
275
276
277
278
279
280
281
282
285
286
287
288
289
290
291
292
293
294
295
298
299
300
301
302
303
304
305
308
309
310
311
312
313
314
315
318
319
320
321
322
323
324
325
328
329
330
331
332
333
334
335
338
339
340
341
342
343
344
345
348
349
350
351
352
353
354
355
356
359
360
361
362
363
364
365
366
369
370
371
372
373
374
375
376
379
380
381
382
383
384
385
386
388using namespace Qt::StringLiterals;
397 return QQmlListProperty<QObject>(
this, &m_data);
406
407
408
409
410
413 return m_controls.value(controlType,
nullptr);
416#define IMPLEMENT_ACCESSORS(NAME, TYPE) QQStyleKitControl
417 *QQStyleKitControls::NAME() const \
418{
419 if (!m_controls.contains(TYPE)) {
420 auto *self = const_cast<QQStyleKitControls *>(this);
421 auto *control = new QQStyleKitControl(self);
422 self->m_controls.insert(TYPE, control);
424 return m_controls[TYPE]; \
425}void
426 QQStyleKitControls::set_ ## NAME(QQStyleKitControl *control) \
427{
428 m_controls.insert(TYPE, control); \
429}
463#undef IMPLEMENT_ACCESSORS
467 for (
auto *obj : children()) {
468 if (
auto *customControl = qobject_cast<QQStyleKitCustomControl *>(obj)) {
469 const QQStyleKitExtendableControlType type = customControl->controlType();
470 const QQStyleKitExtendableControlType reserved
471 = QQStyleKitExtendableControlType(QQStyleKitReader::ControlType::Unspecified);
472 if (type >= reserved)
473 qmlWarning(
this) <<
"CustomControls must use a controlType less than " << reserved;
474 if (m_controls.contains(type))
475 qmlWarning(
this) <<
"CustomControl registered more than once: " << type;
476 m_controls.insert(type, customControl);
483#include "moc_qqstylekitcontrols_p.cpp"
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
const QList< QObject * > children() const
QQmlListProperty< QObject > data()
Combined button and popup list for selecting options.
#define IMPLEMENT_ACCESSORS(NAME, TYPE)