diff options
Diffstat (limited to 'examples/qml/referenceexamples/properties')
4 files changed, 5 insertions, 5 deletions
diff --git a/examples/qml/referenceexamples/properties/birthdayparty.cpp b/examples/qml/referenceexamples/properties/birthdayparty.cpp index 717c3e0f71..9abb08dbd9 100644 --- a/examples/qml/referenceexamples/properties/birthdayparty.cpp +++ b/examples/qml/referenceexamples/properties/birthdayparty.cpp @@ -67,11 +67,11 @@ void BirthdayParty::setHost(Person *c) QQmlListProperty<Person> BirthdayParty::guests() { - return QQmlListProperty<Person>(this, this, + return {this, this, &BirthdayParty::appendGuest, &BirthdayParty::guestCount, &BirthdayParty::guest, - &BirthdayParty::clearGuests); + &BirthdayParty::clearGuests}; } void BirthdayParty::appendGuest(Person* p) { diff --git a/examples/qml/referenceexamples/properties/birthdayparty.h b/examples/qml/referenceexamples/properties/birthdayparty.h index 00c5e443b4..8d62c8dcd5 100644 --- a/examples/qml/referenceexamples/properties/birthdayparty.h +++ b/examples/qml/referenceexamples/properties/birthdayparty.h @@ -68,7 +68,7 @@ class BirthdayParty : public QObject // ![2] // ![3] public: - BirthdayParty(QObject *parent = 0); + BirthdayParty(QObject *parent = nullptr); Person *host() const; void setHost(Person *); diff --git a/examples/qml/referenceexamples/properties/main.cpp b/examples/qml/referenceexamples/properties/main.cpp index fbdbd13fd0..a0a2335034 100644 --- a/examples/qml/referenceexamples/properties/main.cpp +++ b/examples/qml/referenceexamples/properties/main.cpp @@ -65,7 +65,7 @@ int main(int argc, char ** argv) QQmlEngine engine; QQmlComponent component(&engine, QUrl("qrc:example.qml")); - BirthdayParty *party = qobject_cast<BirthdayParty *>(component.create()); + auto *party = qobject_cast<BirthdayParty *>(component.create()); if (party && party->host()) { qWarning() << party->host()->name() << "is having a birthday!"; diff --git a/examples/qml/referenceexamples/properties/person.h b/examples/qml/referenceexamples/properties/person.h index 488f8ebac4..749109dc72 100644 --- a/examples/qml/referenceexamples/properties/person.h +++ b/examples/qml/referenceexamples/properties/person.h @@ -58,7 +58,7 @@ class Person : public QObject Q_PROPERTY(QString name READ name WRITE setName) Q_PROPERTY(int shoeSize READ shoeSize WRITE setShoeSize) public: - Person(QObject *parent = 0); + Person(QObject *parent = nullptr); QString name() const; void setName(const QString &); |