diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-06 08:32:25 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-07-06 08:32:25 (GMT) |
commit | d641b621077d5cc81ce7b3de92af9a0f6d47f4d6 (patch) | |
tree | a6d367c55d3d2ec41cf8bf92a439c8cc14c717d8 /examples/declarative/extending/default/person.h | |
parent | 6c7b88af807cbd2b4d824b8fca0f199ae1413432 (diff) | |
download | Qt-d641b621077d5cc81ce7b3de92af9a0f6d47f4d6.zip Qt-d641b621077d5cc81ce7b3de92af9a0f6d47f4d6.tar.gz Qt-d641b621077d5cc81ce7b3de92af9a0f6d47f4d6.tar.bz2 |
Doc
Diffstat (limited to 'examples/declarative/extending/default/person.h')
-rw-r--r-- | examples/declarative/extending/default/person.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/examples/declarative/extending/default/person.h b/examples/declarative/extending/default/person.h new file mode 100644 index 0000000..872186c --- /dev/null +++ b/examples/declarative/extending/default/person.h @@ -0,0 +1,39 @@ +#ifndef PERSON_H +#define PERSON_H + +#include <QObject> +#include <qml.h> + +class Person : public QObject { +Q_OBJECT +Q_PROPERTY(QString name READ name WRITE setName) +Q_PROPERTY(int shoeSize READ shoeSize WRITE setShoeSize) +public: + Person(QObject *parent = 0); + + QString name() const; + void setName(const QString &); + + int shoeSize() const; + void setShoeSize(int); +private: + QString m_name; + int m_shoeSize; +}; +QML_DECLARE_TYPE(Person); + +class Boy : public Person { +Q_OBJECT +public: + Boy(QObject * parent = 0); +}; +QML_DECLARE_TYPE(Boy); + +class Girl : public Person { +Q_OBJECT +public: + Girl(QObject * parent = 0); +}; +QML_DECLARE_TYPE(Girl); + +#endif // PERSON_H |