summaryrefslogtreecommitdiffstats
path: root/examples/declarative/extending/binding/birthdayparty.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/extending/binding/birthdayparty.h')
-rw-r--r--examples/declarative/extending/binding/birthdayparty.h28
1 files changed, 13 insertions, 15 deletions
diff --git a/examples/declarative/extending/binding/birthdayparty.h b/examples/declarative/extending/binding/birthdayparty.h
index 8486442..c3f033e 100644
--- a/examples/declarative/extending/binding/birthdayparty.h
+++ b/examples/declarative/extending/binding/birthdayparty.h
@@ -49,8 +49,8 @@
class BirthdayPartyAttached : public QObject
{
-Q_OBJECT
-Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp NOTIFY rsvpChanged)
+ Q_OBJECT
+ Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp NOTIFY rsvpChanged)
public:
BirthdayPartyAttached(QObject *object);
@@ -63,43 +63,41 @@ signals:
private:
QDate m_rsvp;
};
-QML_DECLARE_TYPE(BirthdayPartyAttached)
class BirthdayParty : public QObject
{
-Q_OBJECT
+ Q_OBJECT
// ![0]
-Q_PROPERTY(Person *celebrant READ celebrant WRITE setCelebrant NOTIFY celebrantChanged)
+ Q_PROPERTY(Person *host READ host WRITE setHost NOTIFY hostChanged)
// ![0]
-Q_PROPERTY(QDeclarativeListProperty<Person> guests READ guests)
-Q_PROPERTY(QString speaker READ speaker WRITE setSpeaker)
-Q_CLASSINFO("DefaultProperty", "guests")
+ Q_PROPERTY(QDeclarativeListProperty<Person> guests READ guests)
+ Q_PROPERTY(QString announcement READ announcement WRITE setAnnouncement)
+ 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;
Person *guest(int) const;
- QString speaker() const;
- void setSpeaker(const QString &);
+ QString announcement() const;
+ void setAnnouncement(const QString &);
static BirthdayPartyAttached *qmlAttachedProperties(QObject *);
void startParty();
signals:
void partyStarted(const QTime &time);
- void celebrantChanged();
+ void hostChanged();
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