11using namespace Qt::StringLiterals;
20 return QQmlListProperty<QObject>(
this, &m_data);
29
30
31
32
33
36 if (!m_controls.contains(controlType))
38 return m_controls[controlType];
44 QList<QQStyleKitVariation *> list;
45 for (
auto *obj : children()) {
46 if (
auto *variation = qobject_cast<QQStyleKitVariation *>(obj))
47 list.append(variation);
52#define IMPLEMENT_ACCESSORS(NAME, TYPE) QQStyleKitControl
53 *QQStyleKitControls::NAME() const \
54{
55 if (!m_controls.contains(TYPE)) {
56 auto *self = const_cast<QQStyleKitControls *>(this);
57 auto *control = new QQStyleKitControl(self);
58 self->m_controls.insert(TYPE, control);
60 return m_controls[TYPE]; \
61}void
62 QQStyleKitControls::set_ ## NAME(QQStyleKitControl *control) \
63{
64 m_controls.insert(TYPE, control); \
65}
99#undef IMPLEMENT_ACCESSORS
103 for (
auto *obj : children()) {
104 if (
auto *customControl = qobject_cast<QQStyleKitCustomControl *>(obj)) {
105 const QQStyleKitExtendableControlType type = customControl->controlType();
106 const QQStyleKitExtendableControlType reserved
107 = QQStyleKitExtendableControlType(QQStyleKitReader::ControlType::Unspecified);
108 if (type >= reserved)
109 qmlWarning(
this) <<
"CustomControls must use a controlType less than " << reserved;
110 if (m_controls.contains(type))
111 qmlWarning(
this) <<
"CustomControl registered more than once: " << type;
112 m_controls.insert(type, customControl);
119#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
QList< QQStyleKitVariation * > variations() const
QQmlListProperty< QObject > data()
Combined button and popup list for selecting options.
#define IMPLEMENT_ACCESSORS(NAME, TYPE)