diff options
author | Michael Brasser <mbrasser@ford.com> | 2018-03-06 15:56:11 -0600 |
---|---|---|
committer | Michael Brasser <michael.brasser@live.com> | 2018-03-08 03:24:24 +0000 |
commit | ec564258e7f990e698cffa181f6e75cb359fa571 (patch) | |
tree | 6d9714896f31e9e4c4a91b4366ae418eb4426207 | |
parent | 93dc5555a7f815f4366886e3af57718c4c169fcb (diff) |
Add metatype registrations for POD attributesv5.11.0-beta2
Change-Id: Ia2a3b1e81d6f855c7e77741607a885f4a75d18a2
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
-rw-r--r-- | tests/auto/repc/pods/pods.rep | 6 | ||||
-rw-r--r-- | tests/auto/repc/pods/tst_pods.cpp | 10 | ||||
-rw-r--r-- | tools/repc/repcodegenerator.cpp | 5 |
3 files changed, 20 insertions, 1 deletions
diff --git a/tests/auto/repc/pods/pods.rep b/tests/auto/repc/pods/pods.rep index da9a0ca..9eea324 100644 --- a/tests/auto/repc/pods/pods.rep +++ b/tests/auto/repc/pods/pods.rep @@ -1,6 +1,12 @@ #include <QString> +ENUM Test {TRUE, FALSE} + POD PodI(int i) POD PodF(float f) POD PodS(QString s) POD PodIFS(int i, float f, QString s) +POD PodT(QList<TestEnum::Test> t) + +class Container { +}; diff --git a/tests/auto/repc/pods/tst_pods.cpp b/tests/auto/repc/pods/tst_pods.cpp index 5241762..71c0ffb 100644 --- a/tests/auto/repc/pods/tst_pods.cpp +++ b/tests/auto/repc/pods/tst_pods.cpp @@ -39,6 +39,7 @@ class tst_Pods : public QObject { private Q_SLOTS: void testConstructors(); void testMarshalling(); + void testProperty(); }; @@ -77,6 +78,15 @@ void tst_Pods::testMarshalling() } } +void tst_Pods::testProperty() +{ + ContainerReplica::registerMetatypes(); + + PodT pt; + QMetaProperty prop = pt.staticMetaObject.property(0); + QVERIFY(prop.userType() != 0); +} + QTEST_APPLESS_MAIN(tst_Pods) #include "tst_pods.moc" diff --git a/tools/repc/repcodegenerator.cpp b/tools/repc/repcodegenerator.cpp index 3ef6ab9..00cc481 100644 --- a/tools/repc/repcodegenerator.cpp +++ b/tools/repc/repcodegenerator.cpp @@ -195,8 +195,11 @@ void RepCodeGenerator::generate(const AST &ast, Mode mode, QString fileName) generatePOD(stream, pod); QSet<QString> metaTypes; - Q_FOREACH (const POD &pod, ast.pods) + Q_FOREACH (const POD &pod, ast.pods) { metaTypes << pod.name; + Q_FOREACH (const PODAttribute &attribute, pod.attributes) + metaTypes << attribute.type; + } Q_FOREACH (const ASTClass &astClass, ast.classes) { Q_FOREACH (const ASTProperty &property, astClass.properties) metaTypes << property.type; |