summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript/data
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-10 08:58:00 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-10 08:58:00 (GMT)
commit9a05223ea9a6ee0dbaac256607be201ea08e6fb6 (patch)
tree54e5407758a18954bdaf64146b8d3ad8532b9297 /tests/auto/declarative/qdeclarativeecmascript/data
parentac27c8ad39a9646a9e509ba7a58f75eeae10bb6e (diff)
parentbfc6a32c2a203766a6debdf19a265a4f0e198403 (diff)
downloadQt-9a05223ea9a6ee0dbaac256607be201ea08e6fb6.zip
Qt-9a05223ea9a6ee0dbaac256607be201ea08e6fb6.tar.gz
Qt-9a05223ea9a6ee0dbaac256607be201ea08e6fb6.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (119 commits) Add Mac OS X bundle description for qml runtime Cleanup Disallow writes to read-only value type properties Allow undefined to be assigned to QVariant properties Add a Qt.isQtObject() method Fix crash in QML library imports Remove QT_VERSION checks in QML List properties aren't read-only Small doc fix. Make sure WorkerScript thread is stopped on deletion. This also fixes Release ListModel's worker agent on deletion. Doc fixes Fix example Example code style improvements Enable other wrapping modes. TextEdit::wrap changed to TextEdit::wrapMode enumeration Remove use of obsolete "Script" element. unwarn Replace "var" with "variant" in tests Fix test after deletion of GraphicsObjectContainer. ...
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/data')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/numberAssignment.qml18
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml22
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/signalParameterTypes.qml4
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml4
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml9
19 files changed, 118 insertions, 21 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml
index 7c32e56..28252df 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/NestedTypeTransientErrors.qml
@@ -3,7 +3,7 @@ import Qt 4.6
QtObject {
property int b: obj.prop.a
- property var prop;
+ property variant prop;
prop: QtObject {
property int a: 10
}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml b/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml
index 2fec9da..1c88700 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/compiled.qml
@@ -38,7 +38,7 @@ QtObject {
property int d: 176
property string e: "Hello"
property string f: "World"
- property var g: 6.7
- property var h: "!"
- property var i: true
+ property variant g: 6.7
+ property variant h: "!"
+ property variant i: true
}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml
new file mode 100644
index 0000000..6c538fe
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deletedEngine.qml
@@ -0,0 +1,11 @@
+import Qt 4.6
+
+QtObject {
+ function calculate() {
+ return b * 13;
+ }
+
+ property int a: calculate()
+ property int b: 3
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml b/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml
index 6bc3a17..29eba42 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/deletedObject.qml
@@ -2,7 +2,7 @@ import Qt 4.6
import Qt.test 1.0
QtObject {
- property var obj
+ property variant obj
obj: MyQmlObject {
id: myObject
value: 92
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml
index a902312..566f5ed 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/extensionObjects.qml
@@ -1,4 +1,5 @@
import Qt.test 1.0
+import Qt 4.6
MyExtendedObject
{
@@ -7,4 +8,12 @@ MyExtendedObject
coreProperty: extendedProperty
extendedProperty: 9
+
+ property QtObject nested: MyExtendedObject {
+ baseProperty: baseExtendedProperty
+ baseExtendedProperty: 13
+
+ coreProperty: extendedProperty
+ extendedProperty: 9
+ }
}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml
new file mode 100644
index 0000000..4aca111
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/functionErrors.qml
@@ -0,0 +1,10 @@
+import Qt 4.6
+
+QtObject {
+ function myFunction() {
+ a = 10;
+ }
+
+ Component.onCompleted: myFunction();
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml
index 2db0fc6..93054f8 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.1.qml
@@ -4,7 +4,7 @@ import Qt 4.6
MyQmlObject {
objectProperty: if(1) otherObject
- property var obj
+ property variant obj
obj: QtObject {
id: otherObject
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml
index f66428d..5ae8b14 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/idShortcutInvalidates.qml
@@ -4,7 +4,7 @@ import Qt 4.6
MyQmlObject {
objectProperty: otherObject
- property var obj
+ property variant obj
obj: QtObject {
id: otherObject
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js
new file mode 100644
index 0000000..3ffdb33
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.js
@@ -0,0 +1,6 @@
+.pragma library
+
+function test(target)
+{
+ var a = target.a;
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml
new file mode 100644
index 0000000..9e8408f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/libraryScriptAssert.qml
@@ -0,0 +1,7 @@
+import Qt 4.6
+import "libraryScriptAssert.js" as Test
+
+QtObject {
+ id: root
+ Component.onCompleted: Test.test(root);
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml b/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml
index 810f9b6..216e916 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/listProperties.qml
@@ -9,15 +9,12 @@ MyQmlObject {
QtObject { property int a: 11 }
]
- Script {
- function calcTest1() {
- var rv = 0;
- for (var ii = 0; ii < root.objectListProperty.length; ++ii) {
- rv += root.objectListProperty[ii].a;
- }
- return rv;
+ function calcTest1() {
+ var rv = 0;
+ for (var ii = 0; ii < root.objectListProperty.length; ++ii) {
+ rv += root.objectListProperty[ii].a;
}
-
+ return rv;
}
property int test1: calcTest1();
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml b/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml
index 47f4e50..e6d31c7 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/listToVariant.qml
@@ -1,5 +1,5 @@
import Qt 4.6
QtObject {
- property var test: children
+ property variant test: children
}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml b/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml
new file mode 100644
index 0000000..1bf0b81
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/nullObjectBinding.qml
@@ -0,0 +1,8 @@
+import Qt 4.6
+
+QtObject {
+ property QtObject test
+ test: if (1) model
+ property ListModel model
+}
+
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/numberAssignment.qml b/tests/auto/declarative/qdeclarativeecmascript/data/numberAssignment.qml
new file mode 100644
index 0000000..30a77e8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/numberAssignment.qml
@@ -0,0 +1,18 @@
+import Qt.test 1.0
+
+NumberAssignment {
+ test1: if (1) 6.7
+ test2: if (1) "6.7"
+ test3: if (1) 6
+ test4: if (1) "6"
+
+ test5: if (1) 6.7
+ test6: if (1) "6.7"
+ test7: if (1) 6
+ test8: if (1) "6"
+
+ test9: if (1) 6.7
+ test10: if (1) "6.7"
+ test11: if (1) 6
+ test12: if (1) "6"
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml b/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml
index 18e488a..edcd340 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/objectsCompareAsEqual.qml
@@ -3,7 +3,7 @@ import Qt 4.6
Item {
id: root
- property var item: child
+ property variant item: child
Item { id: child }
property bool test1: child == child
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml
new file mode 100644
index 0000000..c66f071
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/propertyAssignmentErrors.qml
@@ -0,0 +1,22 @@
+import Qt 4.6
+
+QtObject {
+ id: root
+
+ property int a
+ property variant b
+
+ Component.onCompleted: {
+ try {
+ root.a = undefined;
+ } catch(e) {
+ console.log (e.fileName + ":" + e.lineNumber + ":" + e);
+ }
+
+ try {
+ root.a = "Hello";
+ } catch(e) {
+ console.log (e.fileName + ":" + e.lineNumber + ":" + e);
+ }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/signalParameterTypes.qml b/tests/auto/declarative/qdeclarativeecmascript/data/signalParameterTypes.qml
index 6fc8b02..ffbe317 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/signalParameterTypes.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/signalParameterTypes.qml
@@ -6,9 +6,9 @@ MyQmlObject
property int intProperty
property real realProperty
property color colorProperty
- property var variantProperty
+ property variant variantProperty
- signal mySignal(int a, real b, color c, var d)
+ signal mySignal(int a, real b, color c, variant d)
onMySignal: { intProperty = a; realProperty = b; colorProperty = c; variantProperty = d; }
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml
index fa7e01c..bd23544 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/transientErrors.qml
@@ -1,9 +1,9 @@
import Qt 4.6
QtObject {
- property var obj: nested
+ property variant obj: nested
- property var obj2
+ property variant obj2
obj2: NestedTypeTransientErrors {
id: nested
}
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml b/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml
new file mode 100644
index 0000000..5488e1a
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/variantsAssignedUndefined.qml
@@ -0,0 +1,9 @@
+import Qt 4.6
+
+QtObject {
+ property bool runTest: false
+ onRunTestChanged: test1 = undefined
+
+ property variant test1: 10
+ property variant test2: (runTest == false)?11:undefined
+}