diff options
Diffstat (limited to 'examples/qml/referenceexamples/methods')
4 files changed, 5 insertions, 5 deletions
diff --git a/examples/qml/referenceexamples/methods/birthdayparty.cpp b/examples/qml/referenceexamples/methods/birthdayparty.cpp index dfb36257eb..7e750e4f4b 100644 --- a/examples/qml/referenceexamples/methods/birthdayparty.cpp +++ b/examples/qml/referenceexamples/methods/birthdayparty.cpp @@ -67,7 +67,7 @@ void BirthdayParty::setHost(Person *c) QQmlListProperty<Person> BirthdayParty::guests() { - return QQmlListProperty<Person>(this, m_guests); + return {this, m_guests}; } int BirthdayParty::guestCount() const @@ -82,7 +82,7 @@ Person *BirthdayParty::guest(int index) const void BirthdayParty::invite(const QString &name) { - Person *person = new Person(this); + auto *person = new Person(this); person->setName(name); m_guests.append(person); } diff --git a/examples/qml/referenceexamples/methods/birthdayparty.h b/examples/qml/referenceexamples/methods/birthdayparty.h index 27c164728a..0eb968a841 100644 --- a/examples/qml/referenceexamples/methods/birthdayparty.h +++ b/examples/qml/referenceexamples/methods/birthdayparty.h @@ -60,7 +60,7 @@ class BirthdayParty : public QObject Q_PROPERTY(Person *host READ host WRITE setHost) Q_PROPERTY(QQmlListProperty<Person> guests READ guests) public: - BirthdayParty(QObject *parent = 0); + BirthdayParty(QObject *parent = nullptr); Person *host() const; void setHost(Person *); diff --git a/examples/qml/referenceexamples/methods/main.cpp b/examples/qml/referenceexamples/methods/main.cpp index 974cc26338..89404ec822 100644 --- a/examples/qml/referenceexamples/methods/main.cpp +++ b/examples/qml/referenceexamples/methods/main.cpp @@ -63,7 +63,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/methods/person.h b/examples/qml/referenceexamples/methods/person.h index 488f8ebac4..749109dc72 100644 --- a/examples/qml/referenceexamples/methods/person.h +++ b/examples/qml/referenceexamples/methods/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 &); |