summaryrefslogtreecommitdiffstats
path: root/examples/declarative/extending/binding/birthdayparty.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/extending/binding/birthdayparty.cpp')
-rw-r--r--examples/declarative/extending/binding/birthdayparty.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/examples/declarative/extending/binding/birthdayparty.cpp b/examples/declarative/extending/binding/birthdayparty.cpp
index 8a409af..62b9c7b 100644
--- a/examples/declarative/extending/binding/birthdayparty.cpp
+++ b/examples/declarative/extending/binding/birthdayparty.cpp
@@ -77,9 +77,19 @@ void BirthdayParty::setCelebrant(Person *c)
emit celebrantChanged();
}
-QmlList<Person *> *BirthdayParty::guests()
+QmlListProperty<Person> BirthdayParty::guests()
{
- return &m_guests;
+ return QmlListProperty<Person>(this, m_guests);
+}
+
+int BirthdayParty::guestCount() const
+{
+ return m_guests.count();
+}
+
+Person *BirthdayParty::guest(int index) const
+{
+ return m_guests.at(index);
}
void BirthdayParty::startParty()