summaryrefslogtreecommitdiffstats
path: root/examples/declarative/extending/attached/birthdayparty.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/extending/attached/birthdayparty.cpp')
-rw-r--r--examples/declarative/extending/attached/birthdayparty.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/examples/declarative/extending/attached/birthdayparty.cpp b/examples/declarative/extending/attached/birthdayparty.cpp
index 9dc13de..ffdda57 100644
--- a/examples/declarative/extending/attached/birthdayparty.cpp
+++ b/examples/declarative/extending/attached/birthdayparty.cpp
@@ -72,9 +72,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);
}
BirthdayPartyAttached *BirthdayParty::qmlAttachedProperties(QObject *object)