@@ -24,6 +24,54 @@ See the test project in test directory for a bit more details.
24
24
25
25
Usage
26
26
======
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
+
27
75
Improting JSON to your class's instance!
28
76
======
29
77
// Importing json into your custom instance
0 commit comments