aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/referenceexamples/properties/birthdayparty.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qml/referenceexamples/properties/birthdayparty.h')
-rw-r--r--examples/qml/referenceexamples/properties/birthdayparty.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/qml/referenceexamples/properties/birthdayparty.h b/examples/qml/referenceexamples/properties/birthdayparty.h
index 8d62c8dcd5..a5704972cc 100644
--- a/examples/qml/referenceexamples/properties/birthdayparty.h
+++ b/examples/qml/referenceexamples/properties/birthdayparty.h
@@ -67,6 +67,7 @@ class BirthdayParty : public QObject
Q_PROPERTY(QQmlListProperty<Person> guests READ guests)
// ![2]
// ![3]
+ QML_ELEMENT
public:
BirthdayParty(QObject *parent = nullptr);
@@ -78,12 +79,16 @@ public:
int guestCount() const;
Person *guest(int) const;
void clearGuests();
+ void replaceGuest(int, Person*);
+ void removeLastGuest();
private:
static void appendGuest(QQmlListProperty<Person>*, Person*);
static int guestCount(QQmlListProperty<Person>*);
static Person* guest(QQmlListProperty<Person>*, int);
static void clearGuests(QQmlListProperty<Person>*);
+ static void replaceGuest(QQmlListProperty<Person>*, int, Person*);
+ static void removeLastGuest(QQmlListProperty<Person>*);
Person *m_host;
QVector<Person *> m_guests;