blob: 3bef2d42c0de453e3b662e9132eab80f9c53138d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#ifndef PERSON_H
#define PERSON_H
#include <QObject>
// ![0]
#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);
// ![0]
#endif // PERSON_H
|