aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/referenceexamples/attached/birthdayparty.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qml/referenceexamples/attached/birthdayparty.h')
-rw-r--r--examples/qml/referenceexamples/attached/birthdayparty.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/qml/referenceexamples/attached/birthdayparty.h b/examples/qml/referenceexamples/attached/birthdayparty.h
index 15375f14d9..308d0652a8 100644
--- a/examples/qml/referenceexamples/attached/birthdayparty.h
+++ b/examples/qml/referenceexamples/attached/birthdayparty.h
@@ -59,6 +59,7 @@ class BirthdayPartyAttached : public QObject
{
Q_OBJECT
Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp)
+ QML_ANONYMOUS
public:
BirthdayPartyAttached(QObject *object);
@@ -75,6 +76,12 @@ class BirthdayParty : public QObject
Q_PROPERTY(Person *host READ host WRITE setHost)
Q_PROPERTY(QQmlListProperty<Person> guests READ guests)
Q_CLASSINFO("DefaultProperty", "guests")
+ QML_ELEMENT
+
+//! [declare attached]
+ QML_ATTACHED(BirthdayPartyAttached)
+//! [declare attached]
+
public:
BirthdayParty(QObject *parent = nullptr);
@@ -93,7 +100,4 @@ private:
QList<Person *> m_guests;
};
-//! [declare attached]
-QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES)
-//! [declare attached]
#endif // BIRTHDAYPARTY_H