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
71
72
73
74
75
76
77
78
79
80
81
82
85
86
87
88
89
90
91
92
95
96
97
98
99
100
101
102
105
106
107
108
109
110
111
112
115
116
117
118
119
120
121
122
123
124
127
128
129
130
131
132
133
134
137
138
139
140
141
142
143
144
147
148
149
150
151
152
153
154
155
156
157
158
159
162
163
164
165
166
167
168
169
172
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
227
228
229
230
231
232
233
234
237
238
239
240
241
242
243
244
245
246
249
250
251
252
253
254
255
256
257
258
261
262
263
264
265
266
267
268
269
270
271
272
273
276
277
278
279
280
281
282
283
284
287
288
289
290
291
292
293
294
295
296
297
300
301
302
303
304
305
306
307
310
311
312
313
314
315
316
317
320
321
322
323
324
325
326
327
330
331
332
333
334
335
336
337
340
341
342
343
344
345
346
347
350
351
352
353
354
355
356
357
358
361
362
363
364
365
366
367
368
371
372
373
374
375
376
377
378
381
382
383
384
385
386
387
388
390using namespace Qt::StringLiterals;
399 return QQmlListProperty<QObject>(
this, &m_data);
408
409
410
411
412
415 return m_controls.value(controlType,
nullptr);
418#define IMPLEMENT_ACCESSORS(NAME, TYPE) QQStyleKitControl
419 *QQStyleKitControls::NAME() const \
420{
421 if (!m_controls.contains(TYPE)) {
422 auto *self = const_cast<QQStyleKitControls *>(this);
423 auto *control = new QQStyleKitControl(self);
424 self->m_controls.insert(TYPE, control);
426 return m_controls[TYPE]; \
427}void
428 QQStyleKitControls::set_ ## NAME(QQStyleKitControl *control) \
429{
430 m_controls.insert(TYPE, control); \
431}
465#undef IMPLEMENT_ACCESSORS
469 for (
auto *obj : children()) {
470 if (
auto *customControl = qobject_cast<QQStyleKitCustomControl *>(obj)) {
471 const QQStyleKitExtendableControlType type = customControl->controlType();
472 const QQStyleKitExtendableControlType reserved
473 = QQStyleKitExtendableControlType(QQStyleKitReader::ControlType::Unspecified);
474 if (type >= reserved)
475 qmlWarning(
this) <<
"CustomControls must use a controlType less than " << reserved;
476 if (m_controls.contains(type))
477 qmlWarning(
this) <<
"CustomControl registered more than once: " << type;
478 m_controls.insert(type, customControl);
485#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)