summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-12 03:58:42 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-12 03:58:42 (GMT)
commit1ea93870fce7ff032053775fb19d42e950dd5ccb (patch)
treeccdf099207d295b062a1abde307da3b5057e771a /tests/auto
parent55e4d0591a2b18e08519144a416d1fea9a625cd8 (diff)
downloadQt-1ea93870fce7ff032053775fb19d42e950dd5ccb.zip
Qt-1ea93870fce7ff032053775fb19d42e950dd5ccb.tar.gz
Qt-1ea93870fce7ff032053775fb19d42e950dd5ccb.tar.bz2
Composite types should assign to object properties
Fixes QT-956
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/qmllanguage/data/CompositeType.qml4
-rw-r--r--tests/auto/declarative/qmllanguage/data/CompositeType2.qml5
-rw-r--r--tests/auto/declarative/qmllanguage/data/CompositeType3.qml5
-rw-r--r--tests/auto/declarative/qmllanguage/data/CompositeType4.qml6
-rw-r--r--tests/auto/declarative/qmllanguage/data/assignCompositeToType.qml18
-rw-r--r--tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp10
6 files changed, 48 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmllanguage/data/CompositeType.qml b/tests/auto/declarative/qmllanguage/data/CompositeType.qml
new file mode 100644
index 0000000..8c5094b
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/CompositeType.qml
@@ -0,0 +1,4 @@
+import Qt 4.6
+
+Object {
+}
diff --git a/tests/auto/declarative/qmllanguage/data/CompositeType2.qml b/tests/auto/declarative/qmllanguage/data/CompositeType2.qml
new file mode 100644
index 0000000..86210e9
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/CompositeType2.qml
@@ -0,0 +1,5 @@
+import Test 1.0
+
+MyQmlObject {
+}
+
diff --git a/tests/auto/declarative/qmllanguage/data/CompositeType3.qml b/tests/auto/declarative/qmllanguage/data/CompositeType3.qml
new file mode 100644
index 0000000..bb5469a
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/CompositeType3.qml
@@ -0,0 +1,5 @@
+import Qt 4.6
+
+Object {
+ property int a
+}
diff --git a/tests/auto/declarative/qmllanguage/data/CompositeType4.qml b/tests/auto/declarative/qmllanguage/data/CompositeType4.qml
new file mode 100644
index 0000000..a6a8168
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/CompositeType4.qml
@@ -0,0 +1,6 @@
+import Test 1.0
+
+MyQmlObject {
+ property int a
+}
+
diff --git a/tests/auto/declarative/qmllanguage/data/assignCompositeToType.qml b/tests/auto/declarative/qmllanguage/data/assignCompositeToType.qml
new file mode 100644
index 0000000..ec2867d
--- /dev/null
+++ b/tests/auto/declarative/qmllanguage/data/assignCompositeToType.qml
@@ -0,0 +1,18 @@
+import Qt 4.6
+import Test 1.0
+
+Object {
+ property Object myProperty
+ property Object myProperty2
+ property Object myProperty3
+ property Object myProperty4
+ property MyQmlObject myProperty5
+ property MyQmlObject myProperty6
+
+ myProperty: CompositeType {}
+ myProperty2: CompositeType2 {}
+ myProperty3: CompositeType3 {}
+ myProperty4: CompositeType4 {}
+ myProperty5: CompositeType2 {}
+ myProperty6: CompositeType4 {}
+}
diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
index ff78e6d..94998c7 100644
--- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
+++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
@@ -39,6 +39,7 @@ private slots:
void assignQmlComponent();
void assignBasicTypes();
void assignTypeExtremes();
+ void assignCompositeToType();
void customParserTypes();
void rootAsQmlComponent();
void inlineQmlComponents();
@@ -323,6 +324,15 @@ void tst_qmllanguage::assignTypeExtremes()
QCOMPARE(object->intProperty(), -0x77359400);
}
+// Test that a composite type can assign to a property of its base type
+void tst_qmllanguage::assignCompositeToType()
+{
+ QmlComponent component(&engine, TEST_FILE("assignCompositeToType.qml"));
+ VERIFY_ERRORS(0);
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
// Tests that custom parser types can be instantiated
void tst_qmllanguage::customParserTypes()
{