From a919ae95d98c6210675e24d6ca683bc60f51d884 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 2 Nov 2021 09:04:21 +0100 Subject: 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 Change-Id: Iebce1b810ce00f29395207d93303363b3b71e52e Reviewed-by: Cristian Maureira-Fredes Reviewed-by: Ulf Hermann (cherry picked from commit c442ed4d65b0319e4abd7a931cfb2f1f72842b84) Reviewed-by: Fabian Kosmale --- examples/qml/referenceexamples/binding/happybirthdaysong.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'examples/qml/referenceexamples/binding/happybirthdaysong.cpp') diff --git a/examples/qml/referenceexamples/binding/happybirthdaysong.cpp b/examples/qml/referenceexamples/binding/happybirthdaysong.cpp index 5f8e6d696e..2722b65e06 100644 --- a/examples/qml/referenceexamples/binding/happybirthdaysong.cpp +++ b/examples/qml/referenceexamples/binding/happybirthdaysong.cpp @@ -50,10 +50,9 @@ #include "happybirthdaysong.h" #include -HappyBirthdaySong::HappyBirthdaySong(QObject *parent) -: QObject(parent), m_line(-1) +HappyBirthdaySong::HappyBirthdaySong(QObject *parent) : + QObject(parent) { - setName(QString()); auto *timer = new QTimer(this); QObject::connect(timer, &QTimer::timeout, this, &HappyBirthdaySong::advance); timer->start(1000); -- cgit v1.2.3