aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2016-11-23 14:45:46 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2016-11-30 13:50:43 +0000
commit6ed23b91b949b7edaf96cdb0f2bba7b21a02de89 (patch)
tree1c409252abf674cbc1bad4fcba247f51d78cb51c /tests/auto/qml/qqmllanguage
parent3b4f00ecb54432f514f184c251a316896a88f91a (diff)
Fix support for namespaced types in property/signal declarations
Declarations such as property Namespace.Item foo or property list<Namespace.Item> foo would get rejected by the grammar due to the lack of productions. This is now encapsulated in the UiPropertyType, which used to be merely an identifier but is now changed to produce a UiQualifiedId - the same type that's also used for MyNamespace.Item { ... } object declarations for example. Task-number: QTBUG-10822 Change-Id: Ic3ac1adbe17c83b24b67950c2f089e267b73b99b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmllanguage')
-rw-r--r--tests/auto/qml/qqmllanguage/data/dynamicObjectProperties.2.qml2
-rw-r--r--tests/auto/qml/qqmllanguage/data/namespacedPropertyTypes.qml8
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp10
3 files changed, 18 insertions, 2 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/dynamicObjectProperties.2.qml b/tests/auto/qml/qqmllanguage/data/dynamicObjectProperties.2.qml
index 319e1f5bc5..f028e5dcac 100644
--- a/tests/auto/qml/qqmllanguage/data/dynamicObjectProperties.2.qml
+++ b/tests/auto/qml/qqmllanguage/data/dynamicObjectProperties.2.qml
@@ -1,7 +1,7 @@
import QtQuick 2.0
import QtQuick 2.0 as Qt47
-Qt.QtObject {
+Qt47.QtObject {
property Qt47.QtObject objectProperty
property list<Qt47.QtObject> objectPropertyList
diff --git a/tests/auto/qml/qqmllanguage/data/namespacedPropertyTypes.qml b/tests/auto/qml/qqmllanguage/data/namespacedPropertyTypes.qml
new file mode 100644
index 0000000000..5ad62edab3
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/namespacedPropertyTypes.qml
@@ -0,0 +1,8 @@
+import QtQuick 2.0 as MyQuick
+
+MyQuick.Item {
+ property MyQuick.Item myProp;
+ property list<MyQuick.Item> myList;
+ default property list<MyQuick.Item> myDefaultList;
+ signal mySignal(MyQuick.Item someItem)
+}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 658b4f5852..f586f7d429 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -255,6 +255,7 @@ private slots:
void arrayBuffer();
void defaultListProperty();
+ void namespacedPropertyTypes();
private:
QQmlEngine engine;
@@ -1397,7 +1398,6 @@ void tst_qqmllanguage::dynamicObjectProperties()
}
{
QQmlComponent component(&engine, testFileUrl("dynamicObjectProperties.2.qml"));
- QEXPECT_FAIL("", "QTBUG-10822", Abort);
VERIFY_ERRORS(0);
QObject *object = component.create();
QVERIFY(object != 0);
@@ -4242,6 +4242,14 @@ void tst_qqmllanguage::defaultListProperty()
QScopedPointer<QObject> o(component.create());
}
+void tst_qqmllanguage::namespacedPropertyTypes()
+{
+ QQmlComponent component(&engine, testFileUrl("namespacedPropertyTypes.qml"));
+ VERIFY_ERRORS(0);
+ QScopedPointer<QObject> o(component.create());
+ QVERIFY(!o.isNull());
+}
+
QTEST_MAIN(tst_qqmllanguage)
#include "tst_qqmllanguage.moc"