aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/referenceexamples/valuesource/birthdayparty.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qml/referenceexamples/valuesource/birthdayparty.cpp')
-rw-r--r--examples/qml/referenceexamples/valuesource/birthdayparty.cpp21
1 files changed, 5 insertions, 16 deletions
diff --git a/examples/qml/referenceexamples/valuesource/birthdayparty.cpp b/examples/qml/referenceexamples/valuesource/birthdayparty.cpp
index 7ad11066cb..ced34c0cbb 100644
--- a/examples/qml/referenceexamples/valuesource/birthdayparty.cpp
+++ b/examples/qml/referenceexamples/valuesource/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
{
@@ -64,12 +60,6 @@ void BirthdayPartyAttached::setRsvp(QDate d)
m_rsvp = d;
}
-
-BirthdayParty::BirthdayParty(QObject *parent)
-: QObject(parent), m_host(nullptr)
-{
-}
-
Person *BirthdayParty::host() const
{
return m_host;
@@ -85,12 +75,12 @@ QQmlListProperty<Person> BirthdayParty::guests()
return {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);
}
@@ -108,11 +98,10 @@ QString BirthdayParty::announcement() const
void BirthdayParty::setAnnouncement(const QString &speak)
{
- qWarning() << qPrintable(speak);
+ qInfo().noquote() << speak;
}
BirthdayPartyAttached *BirthdayParty::qmlAttachedProperties(QObject *object)
{
return new BirthdayPartyAttached(object);
}
-