diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-01-28 15:53:51 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-01-29 08:43:41 +0100 |
commit | eff73ee3197723eb1f5b35ec39bb496a40ab5343 (patch) | |
tree | d93caaa0c0b681566cb4383db095578c8c5f5438 /tests | |
parent | 92c87fec98f0b9e86e74c1660a2962d4aa16964c (diff) |
Expose getter and setter names of C++ classes in qmltypes files
This simply exports the name which are already available in the json
files generated by moc. We do not consider whether the methods are
non-private for now. MEMBER is not supported either, but might be added
if the need actually arises.
Fixes: QTBUG-90711
Change-Id: If3ee18c8ce60499676a7ee22df569cba0912e22f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp | 10 | ||||
-rw-r--r-- | tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp index b5efefba9a..f7a29948a0 100644 --- a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp +++ b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp @@ -57,6 +57,12 @@ void tst_qmltyperegistrar::qmltypesHasHppClassAndNoext() QVERIFY(qmltypesData.contains("Noext")); } +void tst_qmltyperegistrar::qmltypesHasReadAndWrite() +{ + QVERIFY(qmltypesData.contains(R"(read: "eieiei")")); + QVERIFY(qmltypesData.contains(R"(write: "setEieiei")")); +} + void tst_qmltyperegistrar::qmltypesHasFileNames() { QVERIFY(qmltypesData.contains("file: \"hppheader.hpp\"")); @@ -79,8 +85,8 @@ void tst_qmltyperegistrar::superAndForeignTypes() QVERIFY(qmltypesData.contains("values: [\"Pixel\", \"Centimeter\", \"Inch\", \"Point\"]")); QVERIFY(qmltypesData.contains("name: \"SizeGadget\"")); QVERIFY(qmltypesData.contains("prototype: \"SizeEnums\"")); - QVERIFY(qmltypesData.contains("Property { name: \"height\"; type: \"int\" }")); - QVERIFY(qmltypesData.contains("Property { name: \"width\"; type: \"int\" }")); + QVERIFY(qmltypesData.contains("Property { name: \"height\"; type: \"int\"; read: \"height\"; write: \"setHeight\" }")); + QVERIFY(qmltypesData.contains("Property { name: \"width\"; type: \"int\"; read: \"width\"; write: \"setWidth\" }")); QVERIFY(qmltypesData.contains("Method { name: \"sizeToString\"; type: \"QString\" }")); QVERIFY(qmltypesData.contains("extension: \"SizeValueType\"")); } diff --git a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h index 486009ea59..6267868375 100644 --- a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h +++ b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h @@ -158,6 +158,7 @@ private slots: void initTestCase(); void qmltypesHasForeign(); void qmltypesHasHppClassAndNoext(); + void qmltypesHasReadAndWrite(); void qmltypesHasFileNames(); void qmltypesHasFlags(); void superAndForeignTypes(); |