summaryrefslogtreecommitdiffstats
path: root/examples/declarative/extending/default/birthdayparty.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/extending/default/birthdayparty.cpp')
-rw-r--r--examples/declarative/extending/default/birthdayparty.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/examples/declarative/extending/default/birthdayparty.cpp b/examples/declarative/extending/default/birthdayparty.cpp
index 014d307..15a4ca9 100644
--- a/examples/declarative/extending/default/birthdayparty.cpp
+++ b/examples/declarative/extending/default/birthdayparty.cpp
@@ -55,9 +55,19 @@ void BirthdayParty::setCelebrant(Person *c)
m_celebrant = c;
}
-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);
}
QML_DEFINE_TYPE(People, 1,0, BirthdayParty, BirthdayParty);