diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-04-21 00:58:02 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-04-21 00:59:45 (GMT) |
commit | 61f3cb6e79fea0aed80df091013c2228f64955ec (patch) | |
tree | 916d4879a326739673f918fc340bc5a4c356bcb9 /examples/declarative/extending/grouped/person.h | |
parent | e11a5c4d1a1bb80ac03655227c833b560c7cad3c (diff) | |
download | Qt-61f3cb6e79fea0aed80df091013c2228f64955ec.zip Qt-61f3cb6e79fea0aed80df091013c2228f64955ec.tar.gz Qt-61f3cb6e79fea0aed80df091013c2228f64955ec.tar.bz2 |
Improve docs and examples for Extending QML in C++
Diffstat (limited to 'examples/declarative/extending/grouped/person.h')
-rw-r--r-- | examples/declarative/extending/grouped/person.h | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/examples/declarative/extending/grouped/person.h b/examples/declarative/extending/grouped/person.h index 216c015..a031e69 100644 --- a/examples/declarative/extending/grouped/person.h +++ b/examples/declarative/extending/grouped/person.h @@ -43,14 +43,14 @@ #include <QObject> #include <QColor> -#include <qdeclarative.h> -class ShoeDescription : public QObject { -Q_OBJECT -Q_PROPERTY(int size READ size WRITE setSize) -Q_PROPERTY(QColor color READ color WRITE setColor) -Q_PROPERTY(QString brand READ brand WRITE setBrand) -Q_PROPERTY(qreal price READ price WRITE setPrice) +class ShoeDescription : public QObject +{ + Q_OBJECT + Q_PROPERTY(int size READ size WRITE setSize) + Q_PROPERTY(QColor color READ color WRITE setColor) + Q_PROPERTY(QString brand READ brand WRITE setBrand) + Q_PROPERTY(qreal price READ price WRITE setPrice) public: ShoeDescription(QObject *parent = 0); @@ -72,11 +72,12 @@ private: qreal m_price; }; -class Person : public QObject { -Q_OBJECT -Q_PROPERTY(QString name READ name WRITE setName) +class Person : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString name READ name WRITE setName) // ![1] -Q_PROPERTY(ShoeDescription *shoe READ shoe) + Q_PROPERTY(ShoeDescription *shoe READ shoe) // ![1] public: Person(QObject *parent = 0); @@ -90,14 +91,16 @@ private: ShoeDescription m_shoe; }; -class Boy : public Person { -Q_OBJECT +class Boy : public Person +{ + Q_OBJECT public: Boy(QObject * parent = 0); }; -class Girl : public Person { -Q_OBJECT +class Girl : public Person +{ + Q_OBJECT public: Girl(QObject * parent = 0); }; |