diff options
Diffstat (limited to 'examples/declarative/extending/adding/person.cpp')
-rw-r--r-- | examples/declarative/extending/adding/person.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/declarative/extending/adding/person.cpp b/examples/declarative/extending/adding/person.cpp new file mode 100644 index 0000000..4198b63 --- /dev/null +++ b/examples/declarative/extending/adding/person.cpp @@ -0,0 +1,30 @@ +#include "person.h" + +// ![0] +Person::Person(QObject *parent) +: QObject(parent), m_shoeSize(0) +{ +} + +QString Person::name() const +{ + return m_name; +} + +void Person::setName(const QString &n) +{ + m_name = n; +} + +int Person::shoeSize() const +{ + return m_shoeSize; +} + +void Person::setShoeSize(int s) +{ + m_shoeSize = s; +} + +QML_DEFINE_TYPE(Person, Person); +// ![0] |