32 Q_PROPERTY(QVariant roleValue READ roleValue WRITE setRoleValue NOTIFY roleValueChanged FINAL)
33 Q_PROPERTY(
int row READ row WRITE setRow NOTIFY rowChanged FINAL)
34 Q_PROPERTY(
int index READ row WRITE setRow NOTIFY indexChanged FINAL)
35 Q_PROPERTY(
int column READ column WRITE setColumn NOTIFY columnChanged FINAL)
36 Q_PROPERTY(QQmlComponent* delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL)
37 Q_CLASSINFO(
"DefaultProperty",
"delegate")
38 QML_NAMED_ELEMENT(DelegateChoice)
39 QML_ADDED_IN_VERSION(6, 9)
42 QVariant roleValue()
const;
43 void setRoleValue(
const QVariant &roleValue);
49 void setColumn(
int c);
51 QQmlComponent *delegate()
const;
52 void setDelegate(QQmlComponent *delegate);
54 virtual bool match(
int row,
int column,
const QVariant &value)
const;
57 void roleValueChanged();
61 void delegateChanged();
68 QQmlComponent *m_delegate =
nullptr;
74 Q_PROPERTY(QString role READ role WRITE setRole NOTIFY roleChanged FINAL)
75 Q_PROPERTY(QQmlListProperty<QQmlDelegateChoice> choices READ choices CONSTANT FINAL)
76 Q_CLASSINFO(
"DefaultProperty",
"choices")
77 QML_NAMED_ELEMENT(DelegateChooser)
78 QML_ADDED_IN_VERSION(6, 9)
81 QString role()
const final {
return m_role; }
82 void setRole(
const QString &role);
84 virtual QQmlListProperty<QQmlDelegateChoice> choices();
85 static void choices_append(QQmlListProperty<QQmlDelegateChoice> *, QQmlDelegateChoice *);
86 static qsizetype choices_count(QQmlListProperty<QQmlDelegateChoice> *);
87 static QQmlDelegateChoice *choices_at(QQmlListProperty<QQmlDelegateChoice> *, qsizetype);
88 static void choices_clear(QQmlListProperty<QQmlDelegateChoice> *);
89 static void choices_replace(QQmlListProperty<QQmlDelegateChoice> *, qsizetype,
90 QQmlDelegateChoice *);
91 static void choices_removeLast(QQmlListProperty<QQmlDelegateChoice> *);
93 QQmlComponent *delegate(QQmlAdaptorModel *adaptorModel,
int row,
int column = -1)
const override;
100 QList<QQmlDelegateChoice *> m_choices;