summaryrefslogtreecommitdiffstats
path: root/examples/declarative/extending
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-08-19 05:13:09 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-08-19 05:13:09 (GMT)
commit9a954d44aa20e0eb21bdf2820941bd7a1908096d (patch)
treecc001010d783596afd5203781dc2eac992b6b9b5 /examples/declarative/extending
parent9f7f71160053b64a23abc472d9d9ddd5d9bb8b3d (diff)
downloadQt-9a954d44aa20e0eb21bdf2820941bd7a1908096d.zip
Qt-9a954d44aa20e0eb21bdf2820941bd7a1908096d.tar.gz
Qt-9a954d44aa20e0eb21bdf2820941bd7a1908096d.tar.bz2
Various doc fixes.
Make QML docs fit in with the new Qt style. Fix numerous qdoc errors.
Diffstat (limited to 'examples/declarative/extending')
-rw-r--r--examples/declarative/extending/properties/birthdayparty.cpp25
-rw-r--r--examples/declarative/extending/properties/birthdayparty.h35
2 files changed, 60 insertions, 0 deletions
diff --git a/examples/declarative/extending/properties/birthdayparty.cpp b/examples/declarative/extending/properties/birthdayparty.cpp
new file mode 100644
index 0000000..92bc3ba
--- /dev/null
+++ b/examples/declarative/extending/properties/birthdayparty.cpp
@@ -0,0 +1,25 @@
+#include "birthdayparty.h"
+
+BirthdayParty::BirthdayParty(QObject *parent)
+: QObject(parent), m_celebrant(0)
+{
+}
+
+// ![0]
+Person *BirthdayParty::celebrant() const
+{
+ return m_celebrant;
+}
+
+void BirthdayParty::setCelebrant(Person *c)
+{
+ m_celebrant = c;
+}
+
+QmlList<Person *> *BirthdayParty::guests()
+{
+ return &m_guests;
+}
+// ![0]
+
+QML_DEFINE_TYPE(People, 1, 0, 0, BirthdayParty, BirthdayParty);
diff --git a/examples/declarative/extending/properties/birthdayparty.h b/examples/declarative/extending/properties/birthdayparty.h
new file mode 100644
index 0000000..1804980
--- /dev/null
+++ b/examples/declarative/extending/properties/birthdayparty.h
@@ -0,0 +1,35 @@
+#ifndef BIRTHDAYPARTY_H
+#define BIRTHDAYPARTY_H
+
+#include <QObject>
+#include <qml.h>
+#include "person.h"
+
+// ![0]
+class BirthdayParty : public QObject
+{
+Q_OBJECT
+// ![0]
+// ![1]
+Q_PROPERTY(Person *celebrant READ celebrant WRITE setCelebrant)
+// ![1]
+// ![2]
+Q_PROPERTY(QmlList<Person *> *guests READ guests)
+// ![2]
+// ![3]
+public:
+ BirthdayParty(QObject *parent = 0);
+
+ Person *celebrant() const;
+ void setCelebrant(Person *);
+
+ QmlList<Person *> *guests();
+
+private:
+ Person *m_celebrant;
+ QmlConcreteList<Person *> m_guests;
+};
+QML_DECLARE_TYPE(BirthdayParty);
+// ![3]
+
+#endif // BIRTHDAYPARTY_H