Skip to content

Commit f572b31

Browse files
committed
README.md enhanced
1 parent 10a0228 commit f572b31

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,54 @@ See the test project in test directory for a bit more details.
2424

2525
Usage
2626
======
27+
Classes that we'll use for the sample code following ---
28+
class Address : public JObject {
29+
Q_OBJECT
30+
public:
31+
Q_INVOKABLE explicit Address(QObject* parent = 0) : JObject(parent){}
32+
33+
MetaPropertyPublicSet(QString, country)
34+
MetaPropertyPublicSet(QString, city)
35+
MetaPropertyPublicSet(QString, zip)
36+
};
37+
38+
39+
class Person : public JObject {
40+
Q_OBJECT
41+
public:
42+
Q_INVOKABLE explicit Person(QObject* parent = 0) : JObject(parent){}
43+
MetaPropertyPublicSet(QString, name)
44+
MetaPropertyPublicSet_Ptr(Address, address)
45+
};
46+
47+
48+
class Student : public Person {
49+
Q_OBJECT
50+
public:
51+
Q_INVOKABLE explicit Student(QObject* parent = 0) : Person(parent){}
52+
MetaPropertyPublicSet(QStringList, courses)
53+
};
54+
55+
class Teacher : public Person {
56+
Q_OBJECT
57+
public:
58+
Q_INVOKABLE explicit Teacher(QObject* parent = 0) : Person(parent){}
59+
MetaPropertyPublicSet(QStringList, speciality)
60+
};
61+
62+
63+
class School : public JObject {
64+
Q_OBJECT
65+
public:
66+
Q_INVOKABLE explicit School(QObject* parent = 0) : JObject(parent){}
67+
68+
MetaPropertyPublicSet(QString, name)
69+
MetaPropertyPublicSet_Ptr(Address, address)
70+
MetaPropertyPublicSet_Ptr_List(Teacher, teachers)
71+
MetaPropertyPublicSet_Ptr_List(Student, students)
72+
};
73+
74+
2775
Improting JSON to your class's instance!
2876
======
2977
// Importing json into your custom instance

0 commit comments

Comments
 (0)