aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/referenceexamples/attached/birthdayparty.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qml/referenceexamples/attached/birthdayparty.h')
-rw-r--r--examples/qml/referenceexamples/attached/birthdayparty.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/qml/referenceexamples/attached/birthdayparty.h b/examples/qml/referenceexamples/attached/birthdayparty.h
index 4f2ed1702a..30f5cbbb64 100644
--- a/examples/qml/referenceexamples/attached/birthdayparty.h
+++ b/examples/qml/referenceexamples/attached/birthdayparty.h
@@ -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,6 +47,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
#ifndef BIRTHDAYPARTY_H
#define BIRTHDAYPARTY_H
@@ -61,7 +62,7 @@ class BirthdayPartyAttached : public QObject
Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp)
QML_ANONYMOUS
public:
- BirthdayPartyAttached(QObject *object);
+ using QObject::QObject;
QDate rsvp() const;
void setRsvp(QDate);
@@ -83,20 +84,20 @@ class BirthdayParty : public QObject
//! [declare attached]
public:
- BirthdayParty(QObject *parent = nullptr);
+ using QObject::QObject;
Person *host() const;
void setHost(Person *);
QQmlListProperty<Person> guests();
- int guestCount() const;
- Person *guest(int) const;
+ qsizetype guestCount() const;
+ Person *guest(qsizetype) const;
//! [static attached]
static BirthdayPartyAttached *qmlAttachedProperties(QObject *);
//! [static attached]
private:
- Person *m_host;
+ Person *m_host = nullptr;
QList<Person *> m_guests;
};