aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/referenceexamples/binding/birthdayparty.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qml/referenceexamples/binding/birthdayparty.cpp')
-rw-r--r--examples/qml/referenceexamples/binding/birthdayparty.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/examples/qml/referenceexamples/binding/birthdayparty.cpp b/examples/qml/referenceexamples/binding/birthdayparty.cpp
index 02a1adbb35..ce86c7faa4 100644
--- a/examples/qml/referenceexamples/binding/birthdayparty.cpp
+++ b/examples/qml/referenceexamples/binding/birthdayparty.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
@@ -47,12 +47,8 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "birthdayparty.h"
-BirthdayPartyAttached::BirthdayPartyAttached(QObject *object)
-: QObject(object)
-{
-}
+#include "birthdayparty.h"
QDate BirthdayPartyAttached::rsvp() const
{
@@ -67,12 +63,6 @@ void BirthdayPartyAttached::setRsvp(QDate d)
}
}
-
-BirthdayParty::BirthdayParty(QObject *parent)
-: QObject(parent), m_host(nullptr)
-{
-}
-
Person *BirthdayParty::host() const
{
return m_host;
@@ -90,12 +80,12 @@ QQmlListProperty<Person> BirthdayParty::guests()
return QQmlListProperty<Person>(this, &m_guests);
}
-int BirthdayParty::guestCount() const
+qsizetype BirthdayParty::guestCount() const
{
return m_guests.count();
}
-Person *BirthdayParty::guest(int index) const
+Person *BirthdayParty::guest(qsizetype index) const
{
return m_guests.at(index);
}
@@ -113,7 +103,7 @@ QString BirthdayParty::announcement() const
void BirthdayParty::setAnnouncement(const QString &speak)
{
- qWarning() << qPrintable(speak);
+ qWarning().noquote() << speak;
}
BirthdayPartyAttached *BirthdayParty::qmlAttachedProperties(QObject *object)