aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-07-24 08:34:18 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2020-07-28 19:20:53 +0200
commit9ab1a6759018b78b0f160c5286f8b0235a34ec50 (patch)
tree527dbcef8ad883483cdfc511bdee6a432a8c232d /tests
parent4225411b7fceffa87e2e5bbba5dc725cbaba20e5 (diff)
Support required list properties
The corresponding rules were missing so far. Fixes: QTBUG-85716 Change-Id: Ic97546ea2e574f694a96d974ee355ac84f8650b5 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmllanguage/data/RequiredListProperties.qml6
-rw-r--r--tests/auto/qml/qqmllanguage/data/RequiredListPropertiesUser.qml7
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp6
3 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/RequiredListProperties.qml b/tests/auto/qml/qqmllanguage/data/RequiredListProperties.qml
new file mode 100644
index 0000000000..03cf1ad7ef
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/RequiredListProperties.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.15
+
+Item {
+ required property list<Item> listA
+ default required property list<Rectangle> listDefault
+}
diff --git a/tests/auto/qml/qqmllanguage/data/RequiredListPropertiesUser.qml b/tests/auto/qml/qqmllanguage/data/RequiredListPropertiesUser.qml
new file mode 100644
index 0000000000..d8ac85d27c
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/RequiredListPropertiesUser.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.15
+
+RequiredListProperties {
+ Rectangle {}
+ Rectangle {}
+ listA: [Item {}, Item {}]
+}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 0865628061..88f9a39ab8 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -1729,6 +1729,12 @@ void tst_qqmllanguage::requiredProperty()
QVERIFY(!component.errors().empty());
QVERIFY(component.errorString().contains("Property blub was marked as required but does not exist"));
}
+ {
+ QQmlComponent component(&engine, testFileUrl("RequiredListPropertiesUser.qml"));
+ VERIFY_ERRORS(0);
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY(object);
+ }
}
class MyClassWithRequiredProperty : public QObject