diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-11-02 09:04:21 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-11-04 10:51:39 +0100 |
commit | c442ed4d65b0319e4abd7a931cfb2f1f72842b84 (patch) | |
tree | 99009060ae1c23ee98bef51f213926cd961f468a /examples/qml/referenceexamples/properties/main.cpp | |
parent | 33b16814c90fb4b70043be4f65fbbf783aee5d86 (diff) |
Polish the QML reference examples
- Use member initialization, which allows for using
constructors from the base classes
- Use qsizetype for indexes
- Use qInfo() instead of qWarning() for printing
- Add spaces/fix formatting
Pick-to: 6.2
Change-Id: Iebce1b810ce00f29395207d93303363b3b71e52e
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples/qml/referenceexamples/properties/main.cpp')
-rw-r--r-- | examples/qml/referenceexamples/properties/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/qml/referenceexamples/properties/main.cpp b/examples/qml/referenceexamples/properties/main.cpp index e30e1d9fb1..cd71497002 100644 --- a/examples/qml/referenceexamples/properties/main.cpp +++ b/examples/qml/referenceexamples/properties/main.cpp @@ -63,10 +63,10 @@ int main(int argc, char ** argv) auto *party = qobject_cast<BirthdayParty *>(component.create()); if (party && party->host()) { - qWarning() << party->host()->name() << "is having a birthday!"; - qWarning() << "They are inviting:"; - for (int ii = 0; ii < party->guestCount(); ++ii) - qWarning() << " " << party->guest(ii)->name(); + qInfo() << party->host()->name() << "is having a birthday!\n" + "They are inviting:"; + for (qsizetype ii = 0; ii < party->guestCount(); ++ii) + qInfo() << " " << party->guest(ii)->name(); return EXIT_SUCCESS; } |