diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-08-19 11:04:30 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-08-20 08:42:16 +0200 |
commit | 66fabff2530f2080c07bcf89a47474daea4c7c38 (patch) | |
tree | 0ba776e0f62cec2059223fd661098a48deae8801 /examples/qml/referenceexamples/binding | |
parent | 73a9c52fedf25196ed17d55cd1c6b1c1c9fd991d (diff) |
Reference Examples: Use auto for results of new and component.create()
Change-Id: Ibfd92fbc5a99b38cf8b31a11c0adfdfa69e2bb36
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'examples/qml/referenceexamples/binding')
-rw-r--r-- | examples/qml/referenceexamples/binding/happybirthdaysong.cpp | 2 | ||||
-rw-r--r-- | examples/qml/referenceexamples/binding/main.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/qml/referenceexamples/binding/happybirthdaysong.cpp b/examples/qml/referenceexamples/binding/happybirthdaysong.cpp index fae016091b..5f8e6d696e 100644 --- a/examples/qml/referenceexamples/binding/happybirthdaysong.cpp +++ b/examples/qml/referenceexamples/binding/happybirthdaysong.cpp @@ -54,7 +54,7 @@ HappyBirthdaySong::HappyBirthdaySong(QObject *parent) : QObject(parent), m_line(-1) { setName(QString()); - QTimer *timer = new QTimer(this); + auto *timer = new QTimer(this); QObject::connect(timer, &QTimer::timeout, this, &HappyBirthdaySong::advance); timer->start(1000); } diff --git a/examples/qml/referenceexamples/binding/main.cpp b/examples/qml/referenceexamples/binding/main.cpp index cc9ce8f373..99187eba3e 100644 --- a/examples/qml/referenceexamples/binding/main.cpp +++ b/examples/qml/referenceexamples/binding/main.cpp @@ -68,7 +68,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!"; |