11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
58
59
60
61
62
63
64
65
66
67
68
69
72
73
74
75
76
77
78
79
80
81
82
83
86
87
88
89
90
91
92
93
96
97
98
99
100
101
102
103
106
107
108
109
110
111
112
113
116
117
118
119
120
121
122
123
124
125
128
129
130
131
132
133
134
135
138
139
140
141
142
143
144
145
148
149
150
151
152
153
154
155
156
157
158
159
160
163
164
165
166
167
168
169
170
173
174
175
176
177
178
179
180
181
182
183
184
185
186
189
190
191
192
193
194
195
196
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
216
217
218
219
220
221
222
223
226
227
228
229
230
231
232
233
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
254
255
256
257
258
259
260
261
264
265
266
267
268
269
270
271
274
275
276
277
278
279
280
281
282
283
286
287
288
289
290
291
292
293
294
295
298
299
300
301
302
303
304
305
306
307
308
309
310
313
314
315
316
317
318
319
320
321
324
325
326
327
328
329
330
331
332
333
334
337
338
339
340
341
342
343
344
347
348
349
350
351
352
353
354
357
358
359
360
361
362
363
364
367
368
369
370
371
372
373
374
377
378
379
380
381
382
383
384
387
388
389
390
391
392
393
394
395
398
399
400
401
402
403
404
405
408
409
410
411
412
413
414
415
418
419
420
421
422
423
424
425
427using namespace Qt::StringLiterals;
436 return QQmlListProperty<QObject>(
this, &m_data);
445
446
447
448
449
452 return m_controls.value(controlType,
nullptr);
455#define IMPLEMENT_ACCESSORS(NAME, TYPE) QQStyleKitControl
456 *QQStyleKitControls::NAME() const \
457{
458 if (!m_controls.contains(TYPE)) {
459 auto *self = const_cast<QQStyleKitControls *>(this);
460 auto *control = new QQStyleKitControl(self);
461 self->m_controls.insert(TYPE, control);
463 return m_controls[TYPE]; \
464}void
465 QQStyleKitControls::set_ ## NAME(QQStyleKitControl *control) \
466{
467 m_controls.insert(TYPE, control); \
468}
505#undef IMPLEMENT_ACCESSORS
509 for (
auto *obj : children()) {
510 if (
auto *customControl = qobject_cast<QQStyleKitCustomControl *>(obj)) {
511 const QQStyleKitExtendableControlType type = customControl->controlType();
512 const QQStyleKitExtendableControlType reserved
513 = QQStyleKitExtendableControlType(QQStyleKitReader::ControlType::Unspecified);
514 if (type >= reserved)
515 qmlWarning(
this) <<
"CustomControls must use a controlType less than " << reserved;
516 if (m_controls.contains(type))
517 qmlWarning(
this) <<
"CustomControl registered more than once: " << type;
518 m_controls.insert(type, customControl);
525#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)