1
2
3
4
5
6
7
8
9
10
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
|
// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qqstylekitcontrols_p.h"
#include "qqstylekitcontrol_p.h"
#include "qqstylekitcustomcontrol_p.h"
QT_BEGIN_NAMESPACE
/*!
\qmltype StylableControls
\inqmlmodule Qt.labs.StyleKit
\brief Abstract base type containing the control types that can be styled.
StylableControls is an abstract base type. It contains a \l ControlStyle for
each control type that can be styled by a \l Style, \l Theme, or \l StyleVariation.
The control types form a hierarchy where properties set on a base type
propagate down to the more specific ones. For example, assigning a radius
of four to \c abstractButton.background.radius will cause all button
types, such as \l button, \l checkBox, and \l radioButton, to get a radius
of four.
The snippets on this page illustrate a few of the key properties that can be
used to style each control type, but they are by no means exhaustive. Many other properties
are available, as documented in the \l ControlStyle and \l DelegateStyle documentation.
In practice, some of them can also be omitted because the
\l {Style::fallbackStyle}{fallback style} already supplies sensible defaults.
This means that if you simply remove a property from one of the snippets, it
might not actually affect its appearance, since it will just be read from the
fallback style instead.
\sa {StyleKit Property Resolution}
\labs
*/
/*!
\qmlproperty ControlStyle StylableControls::control
Grouped property for styling all controls.
\c control is the base type in the control hierarchy, and properties set here
serve as defaults for all other control types. For example, setting
\c{control.width: 200} makes \e all controls 200 pixels wide,
including buttons, scroll indicators and every other control.
It also overrides any values inherited from a higher level in the style
hierarchy (the \l Style for a \l Theme, or the
\l {Style::fallbackStyle}{fallbackStyle} for a \l Style), \e including hover
effects and other state-based behavior. Use \c{control} sparingly, and
prefer more specific base types like \l abstractButton or \l pane when
possible.
\snippet ControlsSnippets.qml control
*/
/*!
\qmlproperty ControlStyle StylableControls::abstractButton
Grouped property for styling all button-like controls, including
\l [QtQuickControls]{Button}, \l [QtQuickControls]{CheckBox},
\l [QtQuickControls]{RadioButton}, \l [QtQuickControls]{Switch}
and \l [QtQuickControls]{RoundButton}.
Unset properties fall back to \l control.
\snippet ControlsSnippets.qml abstractButton
\sa {Qt Labs StyleKit}{Control Types}
*/
/*!
\qmlproperty ControlStyle StylableControls::applicationWindow
Grouped property for styling \l [QtQuickControls] ApplicationWindow.
Unset properties fall back to \l control.
Use \c applicationWindow to set the background color of the window:
\snippet ControlsSnippets.qml applicationWindow
\note The application needs to use ApplicationWindow, not Window, for this to take effect.
*/
/*!
\qmlproperty ControlStyle StylableControls::busyIndicator
Grouped property for styling \l [QtQuickControls]{BusyIndicator}.
Unset properties fall back to \l control.
\snippet ControlsSnippets.qml busyIndicator
StyleKit doesn't provide dedicated properties to style the animation of the
spinning indicator. To change the shape or animation of the spinning indicator,
you need to implement a custom indicator foreground \l {DelegateStyle::}{delegate}
instead:
\snippet ControlsSnippets.qml busyIndicator delegate
*/
/*!
\qmlproperty ControlStyle StylableControls::button
Grouped property for styling \l [QtQuickControls]{Button}.
Unset properties fall back to \l abstractButton.
\snippet ControlsSnippets.qml button
*/
/*!
\qmlproperty ControlStyle StylableControls::checkBox
Grouped property for styling \l [QtQuickControls]{CheckBox}.
Unset properties fall back to \l abstractButton.
\snippet ControlsSnippets.qml checkBox
*/
/*!
\qmlproperty ControlStyle StylableControls::checkDelegate
Grouped property for styling \l [QtQuickControls]{CheckDelegate}.
Unset properties fall back to \l itemDelegate.
\snippet ControlsSnippets.qml checkDelegate
*/
/*!
\qmlproperty ControlStyle StylableControls::comboBox
Grouped property for styling \l [QtQuickControls]{ComboBox}.
Unset properties fall back to \l control.
\note Style the popup through \l popup, and its items through \l itemDelegate.
\snippet ControlsSnippets.qml comboBox
*/
/*!
\qmlproperty ControlStyle StylableControls::delayButton
Grouped property for styling \l [QtQuickControls]{DelayButton}.
For a delay button, the progress is styled through the indicator. By
default, the indicator itself is transparent and without a border,
so only the indicator's foreground is visible as it fills up.
Unset properties fall back to \l abstractButton.
\snippet ControlsSnippets.qml delayButton
*/
/*!
\qmlproperty ControlStyle StylableControls::dial
Grouped property for styling \l [QtQuickControls]{Dial}.
Unset properties fall back to \l control.
\snippet ControlsSnippets.qml dial
*/
/*!
\qmlproperty ControlStyle StylableControls::dialog
Grouped property for styling \l [QtQuickControls]{Dialog}.
Unset properties fall back to \l popup.
\snippet ControlsSnippets.qml dialog
*/
/*!
\qmlproperty ControlStyle StylableControls::dialogButtonBox
Grouped property for styling \l [QtQuickControls]{DialogButtonBox}.
Unset properties fall back to \l pane.
\snippet ControlsSnippets.qml dialogButtonBox
*/
/*!
\qmlproperty ControlStyle StylableControls::drawer
Grouped property for styling \l [QtQuickControls]{Drawer}.
Unset properties fall back to \l popup.
\snippet ControlsSnippets.qml drawer
*/
/*!
\qmlproperty ControlStyle StylableControls::flatButton
Grouped property for styling flat buttons (buttons with no visible
background in their normal state). The styling will take effect for
a \l [QtQuickControls]{Button} if \l [QtQuickControls]{Button::flat}{Button.flat} is set to \c true.
Unset properties fall back to \l abstractButton.
\snippet ControlsSnippets.qml flatButton
*/
/*!
\qmlproperty ControlStyle StylableControls::frame
Grouped property for styling \l [QtQuickControls]{Frame}.
Unset properties fall back to \l pane.
\snippet ControlsSnippets.qml frame
*/
/*!
\qmlproperty ControlStyle StylableControls::groupBox
Grouped property for styling \l [QtQuickControls]{GroupBox}.
Unset properties fall back to \l frame.
\snippet ControlsSnippets.qml groupBox
*/
/*!
\qmlproperty ControlStyle StylableControls::itemDelegate
Grouped property for styling \l [QtQuickControls]{ItemDelegate}.
Unset properties fall back to \l control.
\note In Qt Quick Controls, \l [QtQuickControls]{ItemDelegate} inherits from
\l [QtQuickControls]{AbstractButton}. In StyleKit, however, \c itemDelegate
falls back to \l control rather than \l abstractButton, since delegates are
typically \e styled very differently from buttons (flat, no borders or drop shadows, etc.).
\snippet ControlsSnippets.qml itemDelegate
*/
/*!
\qmlproperty ControlStyle StylableControls::label
Grouped property for styling \l [QtQuickControls]{Label}.
Unset properties fall back to \l control.
\snippet ControlsSnippets.qml label
*/
/*!
\qmlproperty ControlStyle StylableControls::menu
Grouped property for styling \l [QtQuickControls]{Menu}.
Unset properties fall back to \l popup.
\snippet ControlsSnippets.qml menu
*/
/*!
\qmlproperty ControlStyle StylableControls::menuItem
Grouped property for styling \l [QtQuickControls]{MenuItem}.
Unset properties fall back to \l control.
\note In Qt Quick Controls, a \l [QtQuickControls]{MenuItem} inherits from
\l [QtQuickControls]{AbstractButton}. In StyleKit, however, \c menuItem
falls back to \l control instead of \l abstractButton, since menu items are
typically \e styled very differently from regular buttons
(flat, no borders or drop shadows, etc.).
\snippet ControlsSnippets.qml menuItem
*/
/*!
\qmlproperty ControlStyle StylableControls::menuBar
Grouped property for styling \l [QtQuickControls]{MenuBar}.
Unset properties fall back to \l control.
\note Styling \l [QtQuickControls]{MenuBar}, \l [QtQuickControls]{MenuBarItem},
and \l [QtQuickControls]{MenuSeparator} normally only affects non-native
menu bars. When a MenuBar is implemented as a native menu bar, its delegates
are not used for rendering, so StyleKit style properties may have no visual
effect. See \l [QtLabsPlatform]{MenuBar} {Native Menu Bars} for details.
\snippet ControlsSnippets.qml menuBar
*/
/*!
\qmlproperty ControlStyle StylableControls::menuBarItem
Grouped property for styling menu items in a \l [QtQuickControls]{MenuBar}.
Unset properties fall back to \l control.
\note In Qt Quick Controls, a \l [QtQuickControls]{MenuBarItem} inherits from
\l [QtQuickControls]{AbstractButton}. In StyleKit, however, \c menuBarItem is a
separate control type that falls back to \l control instead of \l abstractButton,
since menu bar items are typically styled very differently from regular buttons
(flat, no borders or drop shadows, etc.).
\snippet ControlsSnippets.qml menuBarItem
*/
/*!
\qmlproperty ControlStyle StylableControls::menuSeparator
Grouped property for styling \l [QtQuickControls]{MenuSeparator}.
Unset properties fall back to \l control.
\snippet ControlsSnippets.qml menuSeparator
*/
/*!
\qmlproperty ControlStyle StylableControls::page
Grouped property for styling \l [QtQuickControls]{Page}.
Unset properties fall back to \l pane.
Note that the \l [QtQuickControls]{Page::header}{header} and
\l [QtQuickControls]{Page::footer}{footer} of a \l [QtQuickControls]{Page} are
typically set by the application to a \l [QtQuickControls]{ToolBar} or
\l [QtQuickControls]{TabBar}, and those controls are styled separately.
To give a \l [QtQuickControls]{ToolBar} alternative styling when used inside
a \l [QtQuickControls]{Page}, use a \l StyleVariation:
\snippet ControlsSnippets.qml page
*/
/*!
\qmlproperty ControlStyle StylableControls::pageIndicator
Grouped property for styling \l [QtQuickControls]{PageIndicator}.
Unset properties fall back to \l control.
\snippet ControlsSnippets.qml pageIndicator
*/
/*!
\qmlproperty ControlStyle StylableControls::pane
Grouped property for styling \l [QtQuickControls]{Pane}.
Unset properties fall back to \l control.
\snippet ControlsSnippets.qml pane
*/
/*!
\qmlproperty ControlStyle StylableControls::popup
Grouped property for styling \l [QtQuickControls]{Popup}.
Unset properties fall back to \l control.
\snippet ControlsSnippets.qml popup
*/
/*!
\qmlproperty ControlStyle StylableControls::progressBar
Grouped property for styling \l [QtQuickControls]{ProgressBar}.
For a progress bar, the groove is styled through the indicator, while the progress
track is styled through the indicator's foreground.
Unset properties fall back to \l control.
\snippet ControlsSnippets.qml progressBar
StyleKit doesn't provide a dedicated property to style the indeterminate animation
of a progress bar. To change the animation, you need to implement a custom indicator
foreground \l {DelegateStyle::}{delegate} instead:
\snippet ControlsSnippets.qml progressBar indeterminate
*/
/*!
\qmlproperty ControlStyle StylableControls::radioButton
Grouped property for styling \l [QtQuickControls]{RadioButton}.
Unset properties fall back to \l abstractButton.
\snippet ControlsSnippets.qml radioButton
*/
/*!
\qmlproperty ControlStyle StylableControls::radioDelegate
Grouped property for styling \l [QtQuickControls]{RadioDelegate}.
Unset properties fall back to \l itemDelegate.
\snippet ControlsSnippets.qml radioDelegate
*/
/*!
\qmlproperty ControlStyle StylableControls::roundButton
Grouped property for styling \l [QtQuickControls]{RoundButton}.
Unset properties fall back to \l abstractButton.
\snippet ControlsSnippets.qml roundButton
*/
/*!
\qmlproperty ControlStyle StylableControls::scrollBar
Grouped property for styling \l [QtQuickControls]{ScrollBar}.
The groove is styled through \l {ControlStyleProperties::}{background}, and the
handle through \l {ControlStyleProperties::}{indicator}.
Unset properties fall back to \l control.
\snippet ControlsSnippets.qml scrollBar
*/
/*!
\qmlproperty ControlStyle StylableControls::scrollIndicator
Grouped property for styling \l [QtQuickControls]{ScrollIndicator}.
The groove is styled through \l {ControlStyleProperties::}{background}, and the
handle through \l {ControlStyleProperties::}{indicator}.
Unset properties fall back to \l control.
\snippet ControlsSnippets.qml scrollIndicator
*/
/*!
\qmlproperty ControlStyle StylableControls::scrollView
Grouped property for styling \l [QtQuickControls]{ScrollView}.
ScrollView itself has no visual delegates to style. Its scroll bars can be
styled separately through the \l scrollBar property. But you can use
\l {ControlStateStyle::padding}{padding} to control the space between
the scroll bars and the content area.
Unset properties fall back to \l control.
\snippet ControlsSnippets.qml scrollView
*/
/*!
\qmlproperty ControlStyle StylableControls::searchField
Grouped property for styling \l [QtQuickControls]{SearchField}.
Unset properties fall back to \l control.
\snippet ControlsSnippets.qml searchField
*/
/*!
\qmlproperty ControlStyle StylableControls::slider
Grouped property for styling \l [QtQuickControls]{Slider}.
For a slider, the groove is styled through the indicator, while the progress
track is styled through the indicator's foreground.
Unset properties fall back to \l control.
For vertical sliders, swap the \l {DelegateStyle::width}{width}
and \l {DelegateStyle::height}{height} of the relevant delegates
so that the control is taller than it is wide, as shown in the snippet below.
\snippet ControlsSnippets.qml slider
*/
/*!
\qmlproperty ControlStyle StylableControls::spinBox
Grouped property for styling \l [QtQuickControls]{SpinBox}.
Unset properties fall back to \l control.
\snippet ControlsSnippets.qml spinBox
\note It's currently only possible to position the up and down buttons to
be on the left or right side of the control, but not on top of each other.
*/
/*!
\qmlproperty ControlStyle StylableControls::swipeDelegate
Grouped property for styling \l [QtQuickControls]{SwipeDelegate}.
Unset properties fall back to \l itemDelegate.
\snippet ControlsSnippets.qml swipeDelegate
*/
/*!
\qmlproperty ControlStyle StylableControls::switchControl
Grouped property for styling \l [QtQuickControls]{Switch}.
Unset properties fall back to \l abstractButton.
\snippet ControlsSnippets.qml switchControl
*/
/*!
\qmlproperty ControlStyle StylableControls::switchDelegate
Grouped property for styling \l [QtQuickControls]{SwitchDelegate}.
Unset properties fall back to \l itemDelegate.
\snippet ControlsSnippets.qml switchDelegate
*/
/*!
\qmlproperty ControlStyle StylableControls::tabBar
Grouped property for styling \l [QtQuickControls]{TabBar}.
Unset properties fall back to \l pane.
\snippet ControlsSnippets.qml tabBar
*/
/*!
\qmlproperty ControlStyle StylableControls::tabButton
Grouped property for styling \l [QtQuickControls]{TabButton}.
Unset properties fall back to \l abstractButton.
\snippet ControlsSnippets.qml tabButton
*/
/*
\qmlproperty ControlStyle StylableControls::tableViewDelegate
Grouped property for styling \l [QtQuickControls]{TableViewDelegate}.
Unset properties fall back to \l itemDelegate.
\snippet ControlsSnippets.qml tableViewDelegate
*/
/*!
\qmlproperty ControlStyle StylableControls::textArea
Grouped property for styling \l [QtQuickControls]{TextArea}.
Unset properties fall back to \l textInput.
\snippet ControlsSnippets.qml textArea
*/
/*!
\qmlproperty ControlStyle StylableControls::textField
Grouped property for styling \l [QtQuickControls]{TextField}.
Unset properties fall back to \l textInput.
\snippet ControlsSnippets.qml textField
*/
/*!
\qmlproperty ControlStyle StylableControls::textInput
Grouped property for styling all text input controls, including
\l [QtQuickControls]{TextField} and \l [QtQuickControls]{TextArea}.
Unset properties fall back to \l control.
\snippet ControlsSnippets.qml textInput
*/
/*!
\qmlproperty ControlStyle StylableControls::toolBar
Grouped property for styling \l [QtQuickControls]{ToolBar}.
Unset properties fall back to \l pane.
\snippet ControlsSnippets.qml toolBar
*/
/*!
\qmlproperty ControlStyle StylableControls::toolButton
Grouped property for styling \l [QtQuickControls]{ToolButton}.
Unset properties fall back to \l abstractButton.
\snippet ControlsSnippets.qml toolButton
*/
/*!
\qmlproperty ControlStyle StylableControls::toolSeparator
Grouped property for styling \l [QtQuickControls]{ToolSeparator}.
Unset properties fall back to \l control.
For vertical separators, swap the \l {DelegateStyle::width}{width}
and \l {DelegateStyle::height}{height} of the relevant delegates
so that the control is taller than it is wide, as shown in the snippet below.
\snippet ControlsSnippets.qml toolSeparator
*/
/*!
\qmlproperty ControlStyle StylableControls::toolTip
Grouped property for styling \l [QtQuickControls]{ToolTip}.
Unset properties fall back to \l popup.
\snippet ControlsSnippets.qml toolTip
*/
/*!
\qmlproperty ControlStyle StylableControls::tumbler
Grouped property for styling \l [QtQuickControls]{Tumbler}.
Unset properties fall back to \l control.
\snippet ControlsSnippets.qml tumbler
*/
using namespace Qt::StringLiterals;
QQStyleKitControls::QQStyleKitControls(QObject *parent)
: QObject(parent)
{
}
QQmlListProperty<QObject> QQStyleKitControls::data()
{
return QQmlListProperty<QObject>(this, &m_data);
}
const QList<QObject *> QQStyleKitControls::children() const
{
return m_data;
}
/*!
\qmlmethod ControlStyle StylableControls::getControlStyle(controlType)
Returns the \l ControlStyle for the given \a controlType, or \c null, if
no \l ControlStyle for the type has been defined.
\a controlType can be one of the built-in types documented by
\l {StyleReader::controlType}{StyleReader.controlType}, or the
\l {CustomControl::controlType}{controlType} of a \l CustomControl.
This function can be used to, for example, read or write a property on
a \l CustomControl's style at runtime:
\snippet ControlsSnippets.qml getControlStyle
\snippet ControlsSnippets.qml getControlStyle-function
If \a controlType is a built-in type (such as \c {StyleReader.Button}),
using for example \c {myStyle.button} or \c {myStyle.getControlStyle(StyleReader.Button)}
to get the \l ControlStyle is \e almost equivalent.
The difference is that the former will lazily create a \l ControlStyle if
it's not yet defined, while the latter will instead return \c null.
This means that for example \c {myStyle.button.padding = 10} is always
safe, while \c {myStyle.getControlStyle(StyleReader.Button).padding = 10} will
fail if \c {myStyle.button} has not been defined in the \l Style.
\sa CustomControl, StyleReader
*/
/* Lazy-create the controls that the style is actually using, when accessed
* from the style/application (e.g from Style or Theme). We don't lazy
* create any controls while resolving style properties, as undefined controls would
* anyway not contain any property overrides. The properties have setters too, to
* allow the style/application to share custom ControlStyle the classical
* way, e.g button: ControlStyle { id: button }. */
QQStyleKitControl* QQStyleKitControls::getControlStyle(QQStyleKitExtendableControlType controlType) const
{
return m_controls.value(controlType, nullptr);
}
#define IMPLEMENT_ACCESSORS(NAME, TYPE) \
QQStyleKitControl *QQStyleKitControls::NAME() const \
{ \
if (!m_controls.contains(TYPE)) { \
auto *self = const_cast<QQStyleKitControls *>(this); \
auto *control = new QQStyleKitControl(self); \
self->m_controls.insert(TYPE, control); \
} \
return m_controls[TYPE]; \
} \
void QQStyleKitControls::set_ ## NAME(QQStyleKitControl *control) \
{ \
m_controls.insert(TYPE, control); \
}
IMPLEMENT_ACCESSORS(abstractButton, QQStyleKitReader::ControlType::AbstractButton)
IMPLEMENT_ACCESSORS(applicationWindow, QQStyleKitReader::ControlType::ApplicationWindow)
IMPLEMENT_ACCESSORS(control, QQStyleKitReader::ControlType::Control)
IMPLEMENT_ACCESSORS(busyIndicator, QQStyleKitReader::ControlType::BusyIndicator)
IMPLEMENT_ACCESSORS(button, QQStyleKitReader::ControlType::Button)
IMPLEMENT_ACCESSORS(flatButton, QQStyleKitReader::ControlType::FlatButton)
IMPLEMENT_ACCESSORS(checkBox, QQStyleKitReader::ControlType::CheckBox)
IMPLEMENT_ACCESSORS(checkDelegate, QQStyleKitReader::ControlType::CheckDelegate)
IMPLEMENT_ACCESSORS(comboBox, QQStyleKitReader::ControlType::ComboBox)
IMPLEMENT_ACCESSORS(delayButton, QQStyleKitReader::ControlType::DelayButton)
IMPLEMENT_ACCESSORS(dial, QQStyleKitReader::ControlType::Dial)
IMPLEMENT_ACCESSORS(dialog, QQStyleKitReader::ControlType::Dialog)
IMPLEMENT_ACCESSORS(dialogButtonBox, QQStyleKitReader::ControlType::DialogButtonBox)
IMPLEMENT_ACCESSORS(drawer, QQStyleKitReader::ControlType::Drawer)
IMPLEMENT_ACCESSORS(progressBar, QQStyleKitReader::ControlType::ProgressBar)
IMPLEMENT_ACCESSORS(scrollBar, QQStyleKitReader::ControlType::ScrollBar)
IMPLEMENT_ACCESSORS(scrollIndicator, QQStyleKitReader::ControlType::ScrollIndicator)
IMPLEMENT_ACCESSORS(scrollView, QQStyleKitReader::ControlType::ScrollView)
IMPLEMENT_ACCESSORS(searchField, QQStyleKitReader::SearchField)
IMPLEMENT_ACCESSORS(slider, QQStyleKitReader::ControlType::Slider)
IMPLEMENT_ACCESSORS(spinBox, QQStyleKitReader::ControlType::SpinBox)
IMPLEMENT_ACCESSORS(swipeDelegate, QQStyleKitReader::ControlType::SwipeDelegate)
IMPLEMENT_ACCESSORS(switchControl, QQStyleKitReader::ControlType::SwitchControl)
IMPLEMENT_ACCESSORS(switchDelegate, QQStyleKitReader::ControlType::SwitchDelegate)
IMPLEMENT_ACCESSORS(tabBar, QQStyleKitReader::ControlType::TabBar)
IMPLEMENT_ACCESSORS(tabButton, QQStyleKitReader::ControlType::TabButton)
IMPLEMENT_ACCESSORS(tableViewDelegate, QQStyleKitReader::ControlType::TableViewDelegate)
IMPLEMENT_ACCESSORS(textField, QQStyleKitReader::ControlType::TextField)
IMPLEMENT_ACCESSORS(textInput, QQStyleKitReader::ControlType::TextInput)
IMPLEMENT_ACCESSORS(toolBar, QQStyleKitReader::ControlType::ToolBar)
IMPLEMENT_ACCESSORS(toolButton, QQStyleKitReader::ControlType::ToolButton)
IMPLEMENT_ACCESSORS(toolSeparator, QQStyleKitReader::ControlType::ToolSeparator)
IMPLEMENT_ACCESSORS(toolTip, QQStyleKitReader::ControlType::ToolTip)
IMPLEMENT_ACCESSORS(tumbler, QQStyleKitReader::ControlType::Tumbler)
IMPLEMENT_ACCESSORS(radioButton, QQStyleKitReader::ControlType::RadioButton)
IMPLEMENT_ACCESSORS(radioDelegate, QQStyleKitReader::ControlType::RadioDelegate)
IMPLEMENT_ACCESSORS(roundButton, QQStyleKitReader::ControlType::RoundButton)
IMPLEMENT_ACCESSORS(itemDelegate, QQStyleKitReader::ControlType::ItemDelegate)
IMPLEMENT_ACCESSORS(popup, QQStyleKitReader::ControlType::Popup)
IMPLEMENT_ACCESSORS(pane, QQStyleKitReader::ControlType::Pane)
IMPLEMENT_ACCESSORS(page, QQStyleKitReader::ControlType::Page)
IMPLEMENT_ACCESSORS(pageIndicator, QQStyleKitReader::ControlType::PageIndicator)
IMPLEMENT_ACCESSORS(frame, QQStyleKitReader::ControlType::Frame)
IMPLEMENT_ACCESSORS(label, QQStyleKitReader::ControlType::Label)
IMPLEMENT_ACCESSORS(groupBox, QQStyleKitReader::ControlType::GroupBox)
IMPLEMENT_ACCESSORS(textArea, QQStyleKitReader::ControlType::TextArea)
IMPLEMENT_ACCESSORS(menu, QQStyleKitReader::ControlType::Menu)
IMPLEMENT_ACCESSORS(menuBar, QQStyleKitReader::ControlType::MenuBar)
IMPLEMENT_ACCESSORS(menuBarItem, QQStyleKitReader::ControlType::MenuBarItem)
IMPLEMENT_ACCESSORS(menuItem, QQStyleKitReader::ControlType::MenuItem)
IMPLEMENT_ACCESSORS(menuSeparator, QQStyleKitReader::ControlType::MenuSeparator)
#undef IMPLEMENT_ACCESSORS
void QQStyleKitControls::componentComplete()
{
for (auto *obj : children()) {
if (auto *customControl = qobject_cast<QQStyleKitCustomControl *>(obj)) {
const QQStyleKitExtendableControlType type = customControl->controlType();
const QQStyleKitExtendableControlType reserved
= QQStyleKitExtendableControlType(QQStyleKitReader::ControlType::Unspecified);
if (type >= reserved)
qmlWarning(this) << "CustomControls must use a controlType less than " << reserved;
if (m_controls.contains(type))
qmlWarning(this) << "CustomControl registered more than once: " << type;
m_controls.insert(type, customControl);
}
}
}
QT_END_NAMESPACE
#include "moc_qqstylekitcontrols_p.cpp"
|