diff options
Diffstat (limited to 'examples/declarative/extending/attached/birthdayparty.h')
-rw-r--r-- | examples/declarative/extending/attached/birthdayparty.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/examples/declarative/extending/attached/birthdayparty.h b/examples/declarative/extending/attached/birthdayparty.h index d8ca2e1..1c66f8c 100644 --- a/examples/declarative/extending/attached/birthdayparty.h +++ b/examples/declarative/extending/attached/birthdayparty.h @@ -48,8 +48,8 @@ class BirthdayPartyAttached : public QObject { -Q_OBJECT -Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp) + Q_OBJECT + Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp) public: BirthdayPartyAttached(QObject *object); @@ -59,19 +59,18 @@ public: private: QDate m_rsvp; }; -QML_DECLARE_TYPE(BirthdayPartyAttached) class BirthdayParty : public QObject { -Q_OBJECT -Q_PROPERTY(Person *celebrant READ celebrant WRITE setCelebrant) -Q_PROPERTY(QDeclarativeListProperty<Person> guests READ guests) -Q_CLASSINFO("DefaultProperty", "guests") + Q_OBJECT + Q_PROPERTY(Person *host READ host WRITE setHost) + Q_PROPERTY(QDeclarativeListProperty<Person> guests READ guests) + Q_CLASSINFO("DefaultProperty", "guests") public: BirthdayParty(QObject *parent = 0); - Person *celebrant() const; - void setCelebrant(Person *); + Person *host() const; + void setHost(Person *); QDeclarativeListProperty<Person> guests(); int guestCount() const; @@ -79,11 +78,10 @@ public: static BirthdayPartyAttached *qmlAttachedProperties(QObject *); private: - Person *m_celebrant; + Person *m_host; QList<Person *> m_guests; }; QML_DECLARE_TYPEINFO(BirthdayParty, QML_HAS_ATTACHED_PROPERTIES) -QML_DECLARE_TYPE(BirthdayParty) #endif // BIRTHDAYPARTY_H |