summaryrefslogtreecommitdiffstats
path: root/examples/declarative/extending/signal/birthdayparty.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-07-07 08:17:33 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-07-07 09:10:35 (GMT)
commit6c901f67fb2f2e73fa362e72d985a04fa57cdf48 (patch)
tree583aab2bd1a6ccac33d310df3e8149da0aece0d5 /examples/declarative/extending/signal/birthdayparty.cpp
parent131541866b374b90e04af75ec1382154c78b69b9 (diff)
downloadQt-6c901f67fb2f2e73fa362e72d985a04fa57cdf48.zip
Qt-6c901f67fb2f2e73fa362e72d985a04fa57cdf48.tar.gz
Qt-6c901f67fb2f2e73fa362e72d985a04fa57cdf48.tar.bz2
Doc
Diffstat (limited to 'examples/declarative/extending/signal/birthdayparty.cpp')
-rw-r--r--examples/declarative/extending/signal/birthdayparty.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/examples/declarative/extending/signal/birthdayparty.cpp b/examples/declarative/extending/signal/birthdayparty.cpp
new file mode 100644
index 0000000..ceb5e15
--- /dev/null
+++ b/examples/declarative/extending/signal/birthdayparty.cpp
@@ -0,0 +1,51 @@
+#include "birthdayparty.h"
+
+BirthdayPartyAttached::BirthdayPartyAttached(QObject *object)
+: QObject(object)
+{
+}
+
+QDate BirthdayPartyAttached::rsvp() const
+{
+ return m_rsvp;
+}
+
+void BirthdayPartyAttached::setRsvp(const QDate &d)
+{
+ m_rsvp = d;
+}
+
+QML_DEFINE_NOCREATE_TYPE(BirthdayPartyAttached);
+
+BirthdayParty::BirthdayParty(QObject *parent)
+: QObject(parent), m_celebrant(0)
+{
+}
+
+Person *BirthdayParty::celebrant() const
+{
+ return m_celebrant;
+}
+
+void BirthdayParty::setCelebrant(Person *c)
+{
+ m_celebrant = c;
+}
+
+QmlList<Person *> *BirthdayParty::guests()
+{
+ return &m_guests;
+}
+
+void BirthdayParty::startParty()
+{
+ QTime time = QTime::currentTime();
+ emit partyStarted(time);
+}
+
+BirthdayPartyAttached *BirthdayParty::qmlAttachedProperties(QObject *object)
+{
+ return new BirthdayPartyAttached(object);
+}
+
+QML_DEFINE_TYPE(BirthdayParty, BirthdayParty);