diff options
Diffstat (limited to 'examples/qml/referenceexamples/signal/birthdayparty.h')
-rw-r--r-- | examples/qml/referenceexamples/signal/birthdayparty.h | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/examples/qml/referenceexamples/signal/birthdayparty.h b/examples/qml/referenceexamples/signal/birthdayparty.h deleted file mode 100644 index 22f3bdf9da..0000000000 --- a/examples/qml/referenceexamples/signal/birthdayparty.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -#ifndef BIRTHDAYPARTY_H -#define BIRTHDAYPARTY_H - -#include <QObject> -#include <QDate> -#include <qqml.h> -#include "person.h" - -class BirthdayPartyAttached : public QObject -{ - Q_OBJECT - Q_PROPERTY(QDate rsvp READ rsvp WRITE setRsvp) - QML_ANONYMOUS -public: - using QObject::QObject; - - QDate rsvp() const; - void setRsvp(QDate); - -private: - QDate m_rsvp; -}; - -class BirthdayParty : public QObject -{ - Q_OBJECT - Q_PROPERTY(Person *host READ host WRITE setHost) - Q_PROPERTY(QQmlListProperty<Person> guests READ guests) - Q_CLASSINFO("DefaultProperty", "guests") - QML_ELEMENT - QML_ATTACHED(BirthdayPartyAttached) -public: - using QObject::QObject; - - Person *host() const; - void setHost(Person *); - - QQmlListProperty<Person> guests(); - qsizetype guestCount() const; - Person *guest(qsizetype) const; - - static BirthdayPartyAttached *qmlAttachedProperties(QObject *); - - void startParty(); -// ![0] -signals: - void partyStarted(QTime time); -// ![0] - -private: - Person *m_host = nullptr; - QList<Person *> m_guests; -}; - -#endif // BIRTHDAYPARTY_H |