From 73a9c52fedf25196ed17d55cd1c6b1c1c9fd991d Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 19 Aug 2019 11:09:48 +0200 Subject: Reference Examples: Use initializer lists to avoid repeating type naems Change-Id: Iff0b31d9b641a55ea246235ba1d7a066592ef0c0 Reviewed-by: Simon Hausmann --- examples/qml/referenceexamples/attached/birthdayparty.cpp | 2 +- examples/qml/referenceexamples/coercion/birthdayparty.cpp | 2 +- examples/qml/referenceexamples/default/birthdayparty.cpp | 2 +- examples/qml/referenceexamples/grouped/birthdayparty.cpp | 2 +- examples/qml/referenceexamples/methods/birthdayparty.cpp | 2 +- examples/qml/referenceexamples/properties/birthdayparty.cpp | 4 ++-- examples/qml/referenceexamples/signal/birthdayparty.cpp | 2 +- examples/qml/referenceexamples/valuesource/birthdayparty.cpp | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) (limited to 'examples/qml/referenceexamples') diff --git a/examples/qml/referenceexamples/attached/birthdayparty.cpp b/examples/qml/referenceexamples/attached/birthdayparty.cpp index 26aa56e86c..da0cb800fc 100644 --- a/examples/qml/referenceexamples/attached/birthdayparty.cpp +++ b/examples/qml/referenceexamples/attached/birthdayparty.cpp @@ -81,7 +81,7 @@ void BirthdayParty::setHost(Person *c) QQmlListProperty BirthdayParty::guests() { - return QQmlListProperty(this, m_guests); + return {this, m_guests}; } int BirthdayParty::guestCount() const diff --git a/examples/qml/referenceexamples/coercion/birthdayparty.cpp b/examples/qml/referenceexamples/coercion/birthdayparty.cpp index e729c42bb5..1bae55076c 100644 --- a/examples/qml/referenceexamples/coercion/birthdayparty.cpp +++ b/examples/qml/referenceexamples/coercion/birthdayparty.cpp @@ -66,7 +66,7 @@ void BirthdayParty::setHost(Person *c) QQmlListProperty BirthdayParty::guests() { - return QQmlListProperty(this, m_guests); + return {this, m_guests}; } int BirthdayParty::guestCount() const diff --git a/examples/qml/referenceexamples/default/birthdayparty.cpp b/examples/qml/referenceexamples/default/birthdayparty.cpp index e729c42bb5..1bae55076c 100644 --- a/examples/qml/referenceexamples/default/birthdayparty.cpp +++ b/examples/qml/referenceexamples/default/birthdayparty.cpp @@ -66,7 +66,7 @@ void BirthdayParty::setHost(Person *c) QQmlListProperty BirthdayParty::guests() { - return QQmlListProperty(this, m_guests); + return {this, m_guests}; } int BirthdayParty::guestCount() const diff --git a/examples/qml/referenceexamples/grouped/birthdayparty.cpp b/examples/qml/referenceexamples/grouped/birthdayparty.cpp index e729c42bb5..1bae55076c 100644 --- a/examples/qml/referenceexamples/grouped/birthdayparty.cpp +++ b/examples/qml/referenceexamples/grouped/birthdayparty.cpp @@ -66,7 +66,7 @@ void BirthdayParty::setHost(Person *c) QQmlListProperty BirthdayParty::guests() { - return QQmlListProperty(this, m_guests); + return {this, m_guests}; } int BirthdayParty::guestCount() const diff --git a/examples/qml/referenceexamples/methods/birthdayparty.cpp b/examples/qml/referenceexamples/methods/birthdayparty.cpp index dfb36257eb..f13c500bcf 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 BirthdayParty::guests() { - return QQmlListProperty(this, m_guests); + return {this, m_guests}; } int BirthdayParty::guestCount() const 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 BirthdayParty::guests() { - return QQmlListProperty(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/signal/birthdayparty.cpp b/examples/qml/referenceexamples/signal/birthdayparty.cpp index a5fbb742a5..9d34cdf146 100644 --- a/examples/qml/referenceexamples/signal/birthdayparty.cpp +++ b/examples/qml/referenceexamples/signal/birthdayparty.cpp @@ -82,7 +82,7 @@ void BirthdayParty::setHost(Person *c) QQmlListProperty BirthdayParty::guests() { - return QQmlListProperty(this, m_guests); + return {this, m_guests}; } int BirthdayParty::guestCount() const diff --git a/examples/qml/referenceexamples/valuesource/birthdayparty.cpp b/examples/qml/referenceexamples/valuesource/birthdayparty.cpp index b107c61570..68d5767e8d 100644 --- a/examples/qml/referenceexamples/valuesource/birthdayparty.cpp +++ b/examples/qml/referenceexamples/valuesource/birthdayparty.cpp @@ -82,7 +82,7 @@ void BirthdayParty::setHost(Person *c) QQmlListProperty BirthdayParty::guests() { - return QQmlListProperty(this, m_guests); + return {this, m_guests}; } int BirthdayParty::guestCount() const -- cgit v1.2.3