diff options
Diffstat (limited to 'examples/declarative/extending/default/birthdayparty.h')
-rw-r--r-- | examples/declarative/extending/default/birthdayparty.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/declarative/extending/default/birthdayparty.h b/examples/declarative/extending/default/birthdayparty.h new file mode 100644 index 0000000..084da10 --- /dev/null +++ b/examples/declarative/extending/default/birthdayparty.h @@ -0,0 +1,30 @@ +#ifndef BIRTHDAYPARTY_H +#define BIRTHDAYPARTY_H + +#include <QObject> +#include <qml.h> +#include "person.h" + +// ![0] +class BirthdayParty : public QObject +{ +Q_OBJECT +Q_PROPERTY(Person *celebrant READ celebrant WRITE setCelebrant) +Q_PROPERTY(QmlList<Person *> *guests READ guests) +Q_CLASSINFO("DefaultProperty", "guests") +public: + BirthdayParty(QObject *parent = 0); + + Person *celebrant() const; + void setCelebrant(Person *); + + QmlList<Person *> *guests(); + +private: + Person *m_celebrant; + QmlConcreteList<Person *> m_guests; +}; +// ![0] +QML_DECLARE_TYPE(BirthdayParty); + +#endif // BIRTHDAYPARTY_H |