diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2010-02-03 11:57:09 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2010-02-03 11:57:09 (GMT) |
commit | ead9159c8bfa94004d29c9a0c4b4c93ecce0951e (patch) | |
tree | 5b588e4379c8525cb937cdbc0b050fc44761fbae /tests/auto | |
parent | 5f11d2125b9cc37768fb8174870ced5934cdacf2 (diff) | |
parent | 3838762e4b572017efc42e9f7dbfc43d262807cf (diff) | |
download | Qt-ead9159c8bfa94004d29c9a0c4b4c93ecce0951e.zip Qt-ead9159c8bfa94004d29c9a0c4b4c93ecce0951e.tar.gz Qt-ead9159c8bfa94004d29c9a0c4b4c93ecce0951e.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests/auto')
166 files changed, 1322 insertions, 363 deletions
diff --git a/tests/auto/declarative/animations/data/badproperty1.qml b/tests/auto/declarative/animations/data/badproperty1.qml index fda322c..d31cae9 100644 --- a/tests/auto/declarative/animations/data/badproperty1.qml +++ b/tests/auto/declarative/animations/data/badproperty1.qml @@ -1,21 +1,21 @@ import Qt 4.6 Rectangle { - id: Wrapper + id: wrapper width: 240 height: 320 Rectangle { - id: MyRect + id: myRect color: "red" width: 50; height: 50 x: 100; y: 100 } states: State { name: "state1" - PropertyChanges { target: MyRect; border.color: "blue" } + PropertyChanges { target: myRect; border.color: "blue" } } transitions: Transition { - ColorAnimation { target: MyRect; to: "red"; property: "border.colr"; duration: 1000 } + ColorAnimation { target: myRect; to: "red"; property: "border.colr"; duration: 1000 } } - Component.onCompleted: if (Wrapper.state == "state1") Wrapper.state = ""; else Wrapper.state = "state1"; + Component.onCompleted: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1"; } diff --git a/tests/auto/declarative/animations/data/badproperty2.qml b/tests/auto/declarative/animations/data/badproperty2.qml index 0e8366a..3b8b111 100644 --- a/tests/auto/declarative/animations/data/badproperty2.qml +++ b/tests/auto/declarative/animations/data/badproperty2.qml @@ -1,21 +1,21 @@ import Qt 4.6 Rectangle { - id: Wrapper + id: wrapper width: 240 height: 320 Rectangle { - id: MyRect + id: myRect color: "red" width: 50; height: 50 x: 100; y: 100 } states: State { name: "state1" - PropertyChanges { target: MyRect; border.color: "blue" } + PropertyChanges { target: myRect; border.color: "blue" } } transitions: Transition { - ColorAnimation { target: MyRect; to: "red"; property: "border"; duration: 1000 } + ColorAnimation { target: myRect; to: "red"; property: "border"; duration: 1000 } } - Component.onCompleted: if (Wrapper.state == "state1") Wrapper.state = ""; else Wrapper.state = "state1"; + Component.onCompleted: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1"; } diff --git a/tests/auto/declarative/animations/data/badtype4.qml b/tests/auto/declarative/animations/data/badtype4.qml index 347e581..b5096f4 100644 --- a/tests/auto/declarative/animations/data/badtype4.qml +++ b/tests/auto/declarative/animations/data/badtype4.qml @@ -1,23 +1,23 @@ import Qt 4.6 Rectangle { - id: Wrapper + id: wrapper width: 240 height: 320 Rectangle { - id: MyRect - objectName: "MyRect" + id: myRect + objectName: "myRect" color: "red" width: 50; height: 50 x: 100; y: 100 MouseRegion { anchors.fill: parent - onClicked: if (Wrapper.state == "state1") Wrapper.state = ""; else Wrapper.state = "state1"; + onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1"; } } states: State { name: "state1" - PropertyChanges { target: MyRect; x: 200; color: "blue" } + PropertyChanges { target: myRect; x: 200; color: "blue" } } transitions: Transition { //comment out each in turn to make sure each only animates the relevant property diff --git a/tests/auto/declarative/animations/data/dotproperty.qml b/tests/auto/declarative/animations/data/dotproperty.qml index 3ddb002..369491f 100644 --- a/tests/auto/declarative/animations/data/dotproperty.qml +++ b/tests/auto/declarative/animations/data/dotproperty.qml @@ -1,22 +1,22 @@ import Qt 4.6 Rectangle { - id: Wrapper + id: wrapper width: 240 height: 320 Rectangle { - id: MyRect + id: myRect color: "red" width: 50; height: 50 x: 100; y: 100 MouseRegion { anchors.fill: parent - onClicked: if (Wrapper.state == "state1") Wrapper.state = ""; else Wrapper.state = "state1"; + onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1"; } } states: State { name: "state1" - PropertyChanges { target: MyRect; border.color: "blue" } + PropertyChanges { target: myRect; border.color: "blue" } } transitions: Transition { ColorAnimation { matchProperties: "border.color"; duration: 1000 } diff --git a/tests/auto/declarative/animations/data/mixedtype1.qml b/tests/auto/declarative/animations/data/mixedtype1.qml index a91c6d3..a9eed24 100644 --- a/tests/auto/declarative/animations/data/mixedtype1.qml +++ b/tests/auto/declarative/animations/data/mixedtype1.qml @@ -1,23 +1,23 @@ import Qt 4.6 Rectangle { - id: Wrapper + id: wrapper width: 240 height: 320 Rectangle { - id: MyRect - objectName: "MyRect" + id: myRect + objectName: "myRect" color: "red" width: 50; height: 50 x: 100; y: 100 MouseRegion { anchors.fill: parent - onClicked: if (Wrapper.state == "state1") Wrapper.state = ""; else Wrapper.state = "state1"; + onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1"; } } states: State { name: "state1" - PropertyChanges { target: MyRect; x: 200; border.width: 10 } + PropertyChanges { target: myRect; x: 200; border.width: 10 } } transitions: Transition { PropertyAnimation { matchProperties: "x,border.width"; duration: 1000 } //x is real, border.width is int diff --git a/tests/auto/declarative/animations/data/mixedtype2.qml b/tests/auto/declarative/animations/data/mixedtype2.qml index d12e913..8acb825 100644 --- a/tests/auto/declarative/animations/data/mixedtype2.qml +++ b/tests/auto/declarative/animations/data/mixedtype2.qml @@ -1,23 +1,23 @@ import Qt 4.6 Rectangle { - id: Wrapper + id: wrapper width: 240 height: 320 Rectangle { - id: MyRect - objectName: "MyRect" + id: myRect + objectName: "myRect" color: "red" width: 50; height: 50 x: 100; y: 100 MouseRegion { anchors.fill: parent - onClicked: if (Wrapper.state == "state1") Wrapper.state = ""; else Wrapper.state = "state1"; + onClicked: if (wrapper.state == "state1") wrapper.state = ""; else wrapper.state = "state1"; } } states: State { name: "state1" - PropertyChanges { target: MyRect; x: 200; color: "blue" } + PropertyChanges { target: myRect; x: 200; color: "blue" } } transitions: Transition { PropertyAnimation { matchProperties: "x,color"; duration: 1000 } //x is real, color is color diff --git a/tests/auto/declarative/pathview/data/pathview.qml b/tests/auto/declarative/pathview/data/pathview.qml index be5673c..8fa8d59 100644 --- a/tests/auto/declarative/pathview/data/pathview.qml +++ b/tests/auto/declarative/pathview/data/pathview.qml @@ -6,7 +6,7 @@ Rectangle { color: "#ffffff" resources: [ Component { - id: Delegate + id: delegate Rectangle { id: wrapper objectName: "wrapper" @@ -38,7 +38,7 @@ Rectangle { width: 240 height: 320 model: testModel - delegate: Delegate + delegate: delegate snapPosition: 0.01 path: Path { startY: 120 diff --git a/tests/auto/declarative/qmlecmascript/data/aliasPropertyAndBinding.qml b/tests/auto/declarative/qmlecmascript/data/aliasPropertyAndBinding.qml index 7fdd8ca..5c3ea1f 100644 --- a/tests/auto/declarative/qmlecmascript/data/aliasPropertyAndBinding.qml +++ b/tests/auto/declarative/qmlecmascript/data/aliasPropertyAndBinding.qml @@ -2,11 +2,11 @@ import Qt 4.6 import Qt.test 1.0 MyQmlObject { - property alias c1: MyObject.c1 + property alias c1: myObject.c1 property int c2: 3 property int c3: c2 objectProperty: QtObject { - id: MyObject + id: myObject property int c1 } } diff --git a/tests/auto/declarative/qmlecmascript/data/assignBasicTypes.qml b/tests/auto/declarative/qmlecmascript/data/assignBasicTypes.qml new file mode 100644 index 0000000..128db69 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/assignBasicTypes.qml @@ -0,0 +1,29 @@ +import Qt.test 1.0 +import Qt 4.6 + +MyTypeObject { + Component.onCompleted: { + flagProperty = "FlagVal1 | FlagVal3" + enumProperty = "EnumVal2" + stringProperty = "Hello World!" + uintProperty = 10 + intProperty = -19 + realProperty = 23.2 + doubleProperty = -19.7 + floatProperty = 8.5 + colorProperty = "red" + dateProperty = "1982-11-25" + timeProperty = "11:11:32" + dateTimeProperty = "2009-05-12T13:22:01" + pointProperty = "99,13" + pointFProperty = "-10.1,12.3" + sizeProperty = "99x13" + sizeFProperty = "0.1x0.2" + rectProperty = "9,7,100x200" + rectFProperty = "1000.1,-10.9,400x90.99" + boolProperty = true + variantProperty = "Hello World!" + vectorProperty = "10,1,2.2" + urlProperty = "main.qml" + } +} diff --git a/tests/auto/declarative/qmlecmascript/data/attachedProperty.qml b/tests/auto/declarative/qmlecmascript/data/attachedProperty.qml index c5088e3..061eda0 100644 --- a/tests/auto/declarative/qmlecmascript/data/attachedProperty.qml +++ b/tests/auto/declarative/qmlecmascript/data/attachedProperty.qml @@ -2,10 +2,10 @@ import Qt.test 1.0 import Qt.test 1.0 as Namespace MyQmlObject { - id: Me + id: me property int a: MyQmlObject.value property int b: Namespace.MyQmlObject.value - property int c: Me.Namespace.MyQmlObject.value - property int d: Me.Namespace.MyQmlObject.value + property int c: me.Namespace.MyQmlObject.value + property int d: me.Namespace.MyQmlObject.value } diff --git a/tests/auto/declarative/qmlecmascript/data/bindingLoop.qml b/tests/auto/declarative/qmlecmascript/data/bindingLoop.qml index 8b22dd1..80545cf 100644 --- a/tests/auto/declarative/qmlecmascript/data/bindingLoop.qml +++ b/tests/auto/declarative/qmlecmascript/data/bindingLoop.qml @@ -3,12 +3,12 @@ import Qt.test 1.0 MyQmlContainer { children : [ MyQmlObject { - id: Object1 - stringProperty: "hello" + Object2.stringProperty + id: object1 + stringProperty: "hello" + object2.stringProperty }, MyQmlObject { - id: Object2 - stringProperty: "hello" + Object1.stringProperty + id: object2 + stringProperty: "hello" + object1.stringProperty } ] } diff --git a/tests/auto/declarative/qmlecmascript/data/constantsOverrideBindings.2.qml b/tests/auto/declarative/qmlecmascript/data/constantsOverrideBindings.2.qml index d205526..207a06b 100644 --- a/tests/auto/declarative/qmlecmascript/data/constantsOverrideBindings.2.qml +++ b/tests/auto/declarative/qmlecmascript/data/constantsOverrideBindings.2.qml @@ -1,11 +1,11 @@ import Qt.test 1.0 MyQmlObject { - property alias c1: MyConstants.c1 - property alias c2: MyConstants.c2 + property alias c1: myConstants.c1 + property alias c2: myConstants.c2 objectProperty: ConstantsOverrideBindings { - id: MyConstants + id: myConstants c2: 10 } } diff --git a/tests/auto/declarative/qmlecmascript/data/dynamicCreation.helper.qml b/tests/auto/declarative/qmlecmascript/data/dynamicCreation.helper.qml deleted file mode 100644 index b26d6e1..0000000 --- a/tests/auto/declarative/qmlecmascript/data/dynamicCreation.helper.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.test 1.0 - -MyQmlObject{ - objectName: "objectTwo" -} diff --git a/tests/auto/declarative/qmlecmascript/data/extendedObjectPropertyLookup.qml b/tests/auto/declarative/qmlecmascript/data/extendedObjectPropertyLookup.qml index ab379c1..9a82ad1 100644 --- a/tests/auto/declarative/qmlecmascript/data/extendedObjectPropertyLookup.qml +++ b/tests/auto/declarative/qmlecmascript/data/extendedObjectPropertyLookup.qml @@ -3,6 +3,6 @@ import Qt 4.6 QtObject { property MyExtendedObject a; - a: MyExtendedObject { id: Root } - property int b: Math.max(Root.extendedProperty, 0) + a: MyExtendedObject { id: root } + property int b: Math.max(root.extendedProperty, 0) } diff --git a/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.1.qml b/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.1.qml index b377b94..2db0fc6 100644 --- a/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.1.qml +++ b/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.1.qml @@ -2,12 +2,12 @@ import Qt.test 1.0 import Qt 4.6 MyQmlObject { - objectProperty: if(1) OtherObject + objectProperty: if(1) otherObject property var obj obj: QtObject { - id: OtherObject + id: otherObject } } diff --git a/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.qml b/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.qml index 40cacf6..f66428d 100644 --- a/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.qml +++ b/tests/auto/declarative/qmlecmascript/data/idShortcutInvalidates.qml @@ -2,11 +2,11 @@ import Qt.test 1.0 import Qt 4.6 MyQmlObject { - objectProperty: OtherObject + objectProperty: otherObject property var obj obj: QtObject { - id: OtherObject + id: otherObject } } diff --git a/tests/auto/declarative/qmlecmascript/data/listToVariant.qml b/tests/auto/declarative/qmlecmascript/data/listToVariant.qml new file mode 100644 index 0000000..47f4e50 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/listToVariant.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +QtObject { + property var test: children +} diff --git a/tests/auto/declarative/qmlecmascript/data/methods.1.qml b/tests/auto/declarative/qmlecmascript/data/methods.1.qml index 42ed9a5..0bbee16 100644 --- a/tests/auto/declarative/qmlecmascript/data/methods.1.qml +++ b/tests/auto/declarative/qmlecmascript/data/methods.1.qml @@ -1,6 +1,6 @@ import Qt.test 1.0 MyQmlObject { - id: MyObject - onBasicSignal: MyObject.methodNoArgs() + id: myObject + onBasicSignal: myObject.methodNoArgs() } diff --git a/tests/auto/declarative/qmlecmascript/data/methods.2.qml b/tests/auto/declarative/qmlecmascript/data/methods.2.qml index 70911f7..9f0c6b1 100644 --- a/tests/auto/declarative/qmlecmascript/data/methods.2.qml +++ b/tests/auto/declarative/qmlecmascript/data/methods.2.qml @@ -1,6 +1,6 @@ import Qt.test 1.0 MyQmlObject { - id: MyObject - onBasicSignal: MyObject.method(163) + id: myObject + onBasicSignal: myObject.method(163) } diff --git a/tests/auto/declarative/qmlecmascript/data/objectsCompareAsEqual.qml b/tests/auto/declarative/qmlecmascript/data/objectsCompareAsEqual.qml index 2526576..18e488a 100644 --- a/tests/auto/declarative/qmlecmascript/data/objectsCompareAsEqual.qml +++ b/tests/auto/declarative/qmlecmascript/data/objectsCompareAsEqual.qml @@ -1,15 +1,15 @@ import Qt 4.6 Item { - id: Root + id: root - property var item: Child - Item { id: Child } + property var item: child + Item { id: child } - property bool test1: Child == Child - property bool test2: Child.parent == Root - property bool test3: Root != Child - property bool test4: item == Child - property bool test5: item != Root + property bool test1: child == child + property bool test2: child.parent == root + property bool test3: root != child + property bool test4: item == child + property bool test5: item != root } diff --git a/tests/auto/declarative/qmlecmascript/data/outerBindingOverridesInnerBinding.qml b/tests/auto/declarative/qmlecmascript/data/outerBindingOverridesInnerBinding.qml index 49ada1f..0a933e8 100644 --- a/tests/auto/declarative/qmlecmascript/data/outerBindingOverridesInnerBinding.qml +++ b/tests/auto/declarative/qmlecmascript/data/outerBindingOverridesInnerBinding.qml @@ -1,12 +1,12 @@ import Qt.test 1.0 MyQmlObject { - property alias c1: MyConstants.c1 - property alias c2: MyConstants.c2 + property alias c1: myConstants.c1 + property alias c2: myConstants.c2 property int c3: 0 objectProperty: ConstantsOverrideBindings { - id: MyConstants + id: myConstants c2: c3 } diff --git a/tests/auto/declarative/qmlecmascript/data/scope.qml b/tests/auto/declarative/qmlecmascript/data/scope.qml index 80222c8..cccd3d3 100644 --- a/tests/auto/declarative/qmlecmascript/data/scope.qml +++ b/tests/auto/declarative/qmlecmascript/data/scope.qml @@ -1,7 +1,7 @@ import Qt 4.6 Item { - id: Root + id: root property int a: 1 property int binding: a @@ -16,7 +16,7 @@ Item { } Item { - id: NestedObject + id: nestedObject Script { function myNestedFunction() { @@ -32,17 +32,17 @@ Item { } ScopeObject { - id: CompObject + id: compObject } - property alias test1: Root.binding - property alias test2: NestedObject.binding - property alias test3: Root.binding2 - property alias test4: NestedObject.binding2 - property alias test5: Root.binding3 - property alias test6: NestedObject.binding3 - property alias test7: Root.binding4 - property alias test8: NestedObject.binding4 - property alias test9: CompObject.binding - property alias test10: CompObject.binding2 + property alias test1: root.binding + property alias test2: nestedObject.binding + property alias test3: root.binding2 + property alias test4: nestedObject.binding2 + property alias test5: root.binding3 + property alias test6: nestedObject.binding3 + property alias test7: root.binding4 + property alias test8: nestedObject.binding4 + property alias test9: compObject.binding + property alias test10: compObject.binding2 } diff --git a/tests/auto/declarative/qmlecmascript/data/signalParameterTypes.qml b/tests/auto/declarative/qmlecmascript/data/signalParameterTypes.qml index 42d26a1..6fc8b02 100644 --- a/tests/auto/declarative/qmlecmascript/data/signalParameterTypes.qml +++ b/tests/auto/declarative/qmlecmascript/data/signalParameterTypes.qml @@ -2,7 +2,7 @@ import Qt.test 1.0 MyQmlObject { - id: Root + id: root property int intProperty property real realProperty property color colorProperty @@ -12,5 +12,5 @@ MyQmlObject onMySignal: { intProperty = a; realProperty = b; colorProperty = c; variantProperty = d; } - onBasicSignal: Root.mySignal(10, 19.2, Qt.rgba(1, 1, 0, 1), Qt.rgba(1, 0, 1, 1)) + onBasicSignal: root.mySignal(10, 19.2, Qt.rgba(1, 1, 0, 1), Qt.rgba(1, 0, 1, 1)) } diff --git a/tests/auto/declarative/qmlecmascript/data/undefinedResetsProperty.2.qml b/tests/auto/declarative/qmlecmascript/data/undefinedResetsProperty.2.qml new file mode 100644 index 0000000..e73d38e2 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/undefinedResetsProperty.2.qml @@ -0,0 +1,10 @@ +import Qt.test 1.0 + +MyQmlObject { + resettableProperty: 19 + + function doReset() { + resettableProperty = undefined; + } +} + diff --git a/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp b/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp index b28d805..f389d2c 100644 --- a/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp +++ b/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp @@ -729,7 +729,7 @@ void tst_QmlGraphicsGridView::changeFlow() // Confirm items positioned correctly and indexes correct int itemCount = findItems<QmlGraphicsItem>(viewport, "wrapper").count(); - for (int i = 3; i < model.count() && i < itemCount; ++i) { + for (int i = 0; i < model.count() && i < itemCount; ++i) { QmlGraphicsItem *item = findItem<QmlGraphicsItem>(viewport, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QVERIFY(item); @@ -748,7 +748,7 @@ void tst_QmlGraphicsGridView::changeFlow() // Confirm items positioned correctly and indexes correct itemCount = findItems<QmlGraphicsItem>(viewport, "wrapper").count(); - for (int i = 3; i < model.count() && i < itemCount; ++i) { + for (int i = 0; i < model.count() && i < itemCount; ++i) { QmlGraphicsItem *item = findItem<QmlGraphicsItem>(viewport, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QVERIFY(item); @@ -952,13 +952,15 @@ QList<T*> tst_QmlGraphicsGridView::findItems(QmlGraphicsItem *parent, const QStr QList<T*> items; const QMetaObject &mo = T::staticMetaObject; //qDebug() << parent->QGraphicsObject::children().count() << "children"; - for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) { - QmlGraphicsItem *item = qobject_cast<QmlGraphicsItem*>(parent->QGraphicsObject::children().at(i)); + for (int i = 0; i < parent->childItems().count(); ++i) { + QmlGraphicsItem *item = qobject_cast<QmlGraphicsItem*>(parent->childItems().at(i)); if(!item) continue; //qDebug() << "try" << item; - if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) + if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { items.append(static_cast<T*>(item)); + //qDebug() << " found:" << item; + } items += findItems<T>(item, objectName); } diff --git a/tests/auto/declarative/qmlgraphicstextedit/data/navigation.qml b/tests/auto/declarative/qmlgraphicstextedit/data/navigation.qml index 5b8613f..dc4aee9 100644 --- a/tests/auto/declarative/qmlgraphicstextedit/data/navigation.qml +++ b/tests/auto/declarative/qmlgraphicstextedit/data/navigation.qml @@ -1,23 +1,23 @@ import Qt 4.6 Rectangle { - property var myInput: Input + property var myinput: input width: 800; height: 600; color: "blue" Item { - id: FirstItem; - KeyNavigation.right: Input + id: firstItem; + KeyNavigation.right: input } - TextEdit { id: Input; focus: true - KeyNavigation.left: FirstItem - KeyNavigation.right: LastItem - KeyNavigation.up: FirstItem - KeyNavigation.down: LastItem + TextEdit { id: input; focus: true + KeyNavigation.left: firstItem + KeyNavigation.right: lastItem + KeyNavigation.up: firstItem + KeyNavigation.down: lastItem } Item { - id: LastItem - KeyNavigation.left: Input + id: lastItem + KeyNavigation.left: input } } diff --git a/tests/auto/declarative/qmlgraphicstextedit/data/readOnly.qml b/tests/auto/declarative/qmlgraphicstextedit/data/readOnly.qml index d2a8ce2..06b57ea 100644 --- a/tests/auto/declarative/qmlgraphicstextedit/data/readOnly.qml +++ b/tests/auto/declarative/qmlgraphicstextedit/data/readOnly.qml @@ -1,11 +1,11 @@ import Qt 4.6 Rectangle { - property var myInput: Input + property var myinput: input width: 800; height: 600; color: "blue" - TextEdit { id: Input; focus: true + TextEdit { id: input; focus: true readOnly: true text: "I am the very model of a modern major general.\n" } diff --git a/tests/auto/declarative/qmlgraphicstextinput/data/navigation.qml b/tests/auto/declarative/qmlgraphicstextinput/data/navigation.qml index 282c52c..637de3a 100644 --- a/tests/auto/declarative/qmlgraphicstextinput/data/navigation.qml +++ b/tests/auto/declarative/qmlgraphicstextinput/data/navigation.qml @@ -1,23 +1,23 @@ import Qt 4.6 Rectangle { - property var myInput: Input + property var myinput: input width: 800; height: 600; color: "blue" Item { - id: FirstItem; - KeyNavigation.right: Input + id: firstItem; + KeyNavigation.right: input } - TextInput { id: Input; focus: true - KeyNavigation.left: FirstItem - KeyNavigation.right: LastItem - KeyNavigation.up: FirstItem - KeyNavigation.down: LastItem + Textinput { id: input; focus: true + KeyNavigation.left: firstItem + KeyNavigation.right: lastItem + KeyNavigation.up: firstItem + KeyNavigation.down: lastItem } Item { - id: LastItem - KeyNavigation.left: Input + id: lastItem + KeyNavigation.left: input } } diff --git a/tests/auto/declarative/qmlgraphicstextinput/data/readOnly.qml b/tests/auto/declarative/qmlgraphicstextinput/data/readOnly.qml index 1389d86..886da0c 100644 --- a/tests/auto/declarative/qmlgraphicstextinput/data/readOnly.qml +++ b/tests/auto/declarative/qmlgraphicstextinput/data/readOnly.qml @@ -1,11 +1,11 @@ import Qt 4.6 Rectangle { - property var myInput: Input + property var myinput: input width: 800; height: 600; color: "blue" - TextInput { id: Input; focus: true + Textinput { id: input; focus: true readOnly: true text: "I am the very model of a modern major general.\n" } diff --git a/tests/auto/declarative/qmllanguage/data/Alias.qml b/tests/auto/declarative/qmllanguage/data/Alias.qml index af6187a..55aa231 100644 --- a/tests/auto/declarative/qmllanguage/data/Alias.qml +++ b/tests/auto/declarative/qmllanguage/data/Alias.qml @@ -1,8 +1,8 @@ import Qt 4.6 QtObject { - id: Root + id: root property int value: 1892 - property alias aliasValue: Root.value + property alias aliasValue: root.value } diff --git a/tests/auto/declarative/qmllanguage/data/alias.1.qml b/tests/auto/declarative/qmllanguage/data/alias.1.qml index 3ad8f38..500b0f6 100644 --- a/tests/auto/declarative/qmllanguage/data/alias.1.qml +++ b/tests/auto/declarative/qmllanguage/data/alias.1.qml @@ -2,7 +2,7 @@ import Test 1.0 import Qt 4.6 QtObject { - id: Root + id: root property int value: 10 - property alias valueAlias: Root.value + property alias valueAlias: root.value } diff --git a/tests/auto/declarative/qmllanguage/data/alias.2.qml b/tests/auto/declarative/qmllanguage/data/alias.2.qml index aa4d103..5c92270 100644 --- a/tests/auto/declarative/qmllanguage/data/alias.2.qml +++ b/tests/auto/declarative/qmllanguage/data/alias.2.qml @@ -1,8 +1,8 @@ import Test 1.0 MyQmlObject { - id: Root - property alias aliasObject: Root.qmlobjectProperty + id: root + property alias aliasObject: root.qmlobjectProperty qmlobjectProperty: MyQmlObject { value : 10 } } diff --git a/tests/auto/declarative/qmllanguage/data/alias.3.qml b/tests/auto/declarative/qmllanguage/data/alias.3.qml index fa8a253..e059937 100644 --- a/tests/auto/declarative/qmllanguage/data/alias.3.qml +++ b/tests/auto/declarative/qmllanguage/data/alias.3.qml @@ -2,9 +2,9 @@ import Qt 4.6 QtObject { property var other - other: Alias { id: MyAliasObject } + other: Alias { id: myAliasObject } - property alias value: MyAliasObject.aliasValue - property alias value2: MyAliasObject.value + property alias value: myAliasObject.aliasValue + property alias value2: myAliasObject.value } diff --git a/tests/auto/declarative/qmllanguage/data/alias.8.qml b/tests/auto/declarative/qmllanguage/data/alias.8.qml index 38dc10f..2b9ad85 100644 --- a/tests/auto/declarative/qmllanguage/data/alias.8.qml +++ b/tests/auto/declarative/qmllanguage/data/alias.8.qml @@ -2,8 +2,8 @@ import Qt 4.6 QtObject { property var other - other: Alias3 { id: MyAliasObject } + other: Alias3 { id: myAliasObject } - property int value: MyAliasObject.obj.myValue + property int value: myAliasObject.obj.myValue } diff --git a/tests/auto/declarative/qmllanguage/data/alias.9.qml b/tests/auto/declarative/qmllanguage/data/alias.9.qml index 8061f99..a2a41a1 100644 --- a/tests/auto/declarative/qmllanguage/data/alias.9.qml +++ b/tests/auto/declarative/qmllanguage/data/alias.9.qml @@ -2,8 +2,8 @@ import Qt 4.6 QtObject { property var other - other: Alias4 { id: MyAliasObject } + other: Alias4 { id: myAliasObject } - property int value: MyAliasObject.obj.myValue + property int value: myAliasObject.obj.myValue } diff --git a/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.qml b/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.qml index e607768..00cc0c4 100644 --- a/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.qml +++ b/tests/auto/declarative/qmllanguage/data/customParserIdNotAllowed.qml @@ -1,5 +1,5 @@ import Qt 4.6 ListModel { ListElement { a: 10 } - ListElement { id: Foo; a: 12 } + ListElement { id: foo; a: 12 } } diff --git a/tests/auto/declarative/qmllanguage/data/declaredPropertyValues.qml b/tests/auto/declarative/qmllanguage/data/declaredPropertyValues.qml new file mode 100644 index 0000000..3987a3c --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/declaredPropertyValues.qml @@ -0,0 +1,8 @@ +import Qt 4.6 + +QtObject { + property int a: 10 + property int b: 10 + a + property QtObject c: QtObject {} + property list<QtObject> d: [ QtObject {}, QtObject {} ] +} diff --git a/tests/auto/declarative/qmllanguage/data/defaultPropertyListOrder.qml b/tests/auto/declarative/qmllanguage/data/defaultPropertyListOrder.qml new file mode 100644 index 0000000..3651511 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/defaultPropertyListOrder.qml @@ -0,0 +1,29 @@ +import Test 1.0 +import Qt 4.6 + +MyContainer { + QtObject { + property int index: 0 + } + + QtObject { + property int index: 1 + } + + children: [ + QtObject { + property int index: 2 + }, + QtObject { + property int index: 3 + } + ] + + QtObject { + property int index: 4 + } + + QtObject { + property int index: 5 + } +} diff --git a/tests/auto/declarative/qmllanguage/data/duplicateIDs.qml b/tests/auto/declarative/qmllanguage/data/duplicateIDs.qml index 9605b5b..a993abd 100644 --- a/tests/auto/declarative/qmllanguage/data/duplicateIDs.qml +++ b/tests/auto/declarative/qmllanguage/data/duplicateIDs.qml @@ -1,6 +1,6 @@ import Test 1.0 MyContainer { - MyQmlObject { id: MyID } - MyQmlObject { id: MyID } + MyQmlObject { id: myID } + MyQmlObject { id: myID } } diff --git a/tests/auto/declarative/qmllanguage/data/idProperty.qml b/tests/auto/declarative/qmllanguage/data/idProperty.qml index a413c0b..90c1483 100644 --- a/tests/auto/declarative/qmllanguage/data/idProperty.qml +++ b/tests/auto/declarative/qmllanguage/data/idProperty.qml @@ -1,8 +1,8 @@ import Test 1.0 MyContainer { - property var object : MyObjectId + property var object : myObjectId MyTypeObject { - id: "MyObjectId" + id: "myObjectId" } } diff --git a/tests/auto/declarative/qmllanguage/data/inlineQmlComponents.qml b/tests/auto/declarative/qmllanguage/data/inlineQmlComponents.qml index 79ceda6..478f06a 100644 --- a/tests/auto/declarative/qmllanguage/data/inlineQmlComponents.qml +++ b/tests/auto/declarative/qmllanguage/data/inlineQmlComponents.qml @@ -2,7 +2,7 @@ import Test 1.0 import Qt 4.6 MyContainer { Component { - id: MyComponent + id: myComponent MyQmlObject { value: 11 } diff --git a/tests/auto/declarative/qmllanguage/data/invalidID.4.qml b/tests/auto/declarative/qmllanguage/data/invalidID.4.qml index 1f15fce..86010bf 100644 --- a/tests/auto/declarative/qmllanguage/data/invalidID.4.qml +++ b/tests/auto/declarative/qmllanguage/data/invalidID.4.qml @@ -1,6 +1,6 @@ import Test 1.0 MyQmlObject { - id: Hello - id: World + id: hello + id: world } diff --git a/tests/auto/declarative/qmllanguage/data/invalidID.5.qml b/tests/auto/declarative/qmllanguage/data/invalidID.5.qml index 0545b0d..5b92a1a 100644 --- a/tests/auto/declarative/qmllanguage/data/invalidID.5.qml +++ b/tests/auto/declarative/qmllanguage/data/invalidID.5.qml @@ -1,6 +1,6 @@ import Test 1.0 -import Test 1.0 as Hello +import Test 1.0 as hello MyQmlObject { - id: Hello + id: hello } diff --git a/tests/auto/declarative/qmllanguage/data/invalidID.6.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidID.6.errors.txt index 861e3d7..160e8b5 100644 --- a/tests/auto/declarative/qmllanguage/data/invalidID.6.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/invalidID.6.errors.txt @@ -1 +1 @@ -3:9:id conflicts with type name +3:5:"StartsWithUpperCase" is not a valid object id diff --git a/tests/auto/declarative/qmllanguage/data/invalidID.6.qml b/tests/auto/declarative/qmllanguage/data/invalidID.6.qml index ea34007..62187d9 100644 --- a/tests/auto/declarative/qmllanguage/data/invalidID.6.qml +++ b/tests/auto/declarative/qmllanguage/data/invalidID.6.qml @@ -1,5 +1,5 @@ import Test 1.0 MyQmlObject { - id: MyQmlObject + id: StartsWithUpperCase } diff --git a/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml b/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml index fa2e831..779c6d4 100644 --- a/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml +++ b/tests/auto/declarative/qmllanguage/data/listItemDeleteSelf.qml @@ -2,7 +2,7 @@ import Qt 4.6 Item { ListModel { - id: FruitModel + id: fruitModel ListElement { name: "Apple" cost: 2.45 @@ -18,21 +18,21 @@ Item { } Component { - id: FruitDelegate + id: fruitDelegate Item { width: 200; height: 50 Text { text: name } Text { text: '$'+cost; anchors.right: parent.right } MouseRegion { anchors.fill: parent - onClicked: FruitModel.remove(index) + onClicked: fruitModel.remove(index) } } } ListView { - model: FruitModel - delegate: FruitDelegate + model: fruitModel + delegate: fruitDelegate anchors.fill: parent } } diff --git a/tests/auto/declarative/qmllanguage/data/simpleBindings.qml b/tests/auto/declarative/qmllanguage/data/simpleBindings.qml index 74867b3..2fcd1a5 100644 --- a/tests/auto/declarative/qmllanguage/data/simpleBindings.qml +++ b/tests/auto/declarative/qmllanguage/data/simpleBindings.qml @@ -1,6 +1,6 @@ import Test 1.0 MyTypeObject { - id: Me + id: me property int v1: 10 property int v2: 11 @@ -10,9 +10,9 @@ MyTypeObject { property int value4 value1: v1 - value2: Me.v1 + value2: me.v1 value3: v1 + v2 value4: Math.min(v1, v2) - objectProperty: Me + objectProperty: me } diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp index 0a636db..54442d5 100644 --- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp +++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp @@ -109,6 +109,8 @@ private slots: void i18n_data(); void onCompleted(); void scriptString(); + void defaultPropertyListOrder(); + void declaredPropertyValues(); void importsBuiltin_data(); void importsBuiltin(); @@ -528,7 +530,7 @@ void tst_qmllanguage::idProperty() MyTypeObject *child = qobject_cast<MyTypeObject *>(object->children()->at(0)); QVERIFY(child != 0); - QCOMPARE(child->id(), QString("MyObjectId")); + QCOMPARE(child->id(), QString("myObjectId")); QCOMPARE(object->property("object"), QVariant::fromValue((QObject *)child)); } @@ -1019,6 +1021,32 @@ void tst_qmllanguage::scriptString() QCOMPARE(object->grouped()->script().context(), qmlContext(object)); } +// Check that default property assignments are correctly spliced into explicit +// property assignments +void tst_qmllanguage::defaultPropertyListOrder() +{ + QmlComponent component(&engine, TEST_FILE("defaultPropertyListOrder.qml")); + VERIFY_ERRORS(0); + + MyContainer *container = qobject_cast<MyContainer *>(component.create()); + QVERIFY(container != 0); + + QCOMPARE(container->children()->count(), 6); + QCOMPARE(container->children()->at(0)->property("index"), QVariant(0)); + QCOMPARE(container->children()->at(1)->property("index"), QVariant(1)); + QCOMPARE(container->children()->at(2)->property("index"), QVariant(2)); + QCOMPARE(container->children()->at(3)->property("index"), QVariant(3)); + QCOMPARE(container->children()->at(4)->property("index"), QVariant(4)); + QCOMPARE(container->children()->at(5)->property("index"), QVariant(5)); +} + +void tst_qmllanguage::declaredPropertyValues() +{ + QmlComponent component(&engine, TEST_FILE("declaredPropertyValues.qml")); + QEXPECT_FAIL("", "QTBUG-7860", Abort); + VERIFY_ERRORS(0); +} + // Check that first child of qml is of given type. Empty type insists on error. void tst_qmllanguage::testType(const QString& qml, const QString& type) { diff --git a/tests/auto/declarative/shared/testhttpserver.cpp b/tests/auto/declarative/shared/testhttpserver.cpp index 6c9d849..490fc95 100644 --- a/tests/auto/declarative/shared/testhttpserver.cpp +++ b/tests/auto/declarative/shared/testhttpserver.cpp @@ -115,6 +115,11 @@ void TestHTTPServer::addAlias(const QString &filename, const QString &alias) aliases.insert(filename, alias); } +void TestHTTPServer::addRedirect(const QString &filename, const QString &redirectName) +{ + redirects.insert(filename, redirectName); +} + bool TestHTTPServer::wait(const QUrl &expect, const QUrl &reply, const QUrl &body) { m_hasFailed = false; @@ -230,6 +235,12 @@ void TestHTTPServer::readyRead() bool TestHTTPServer::reply(QTcpSocket *socket, const QByteArray &fileName) { + if (redirects.contains(fileName)) { + QByteArray response = "HTTP/1.1 302 Found\r\nContent-length: 0\r\nContent-type: text/html; charset=UTF-8\r\nLocation: " + redirects[fileName].toUtf8() + "\r\n\r\n"; + socket->write(response); + return true; + } + for (int ii = 0; ii < dirs.count(); ++ii) { QString dir = dirs.at(ii).first; Mode mode = dirs.at(ii).second; diff --git a/tests/auto/declarative/shared/testhttpserver.h b/tests/auto/declarative/shared/testhttpserver.h index 2a8709f..178122d 100644 --- a/tests/auto/declarative/shared/testhttpserver.h +++ b/tests/auto/declarative/shared/testhttpserver.h @@ -62,6 +62,7 @@ public: bool hasFailed() const; void addAlias(const QString &filename, const QString &aliasName); + void addRedirect(const QString &filename, const QString &redirectName); private slots: void newConnection(); @@ -83,6 +84,7 @@ private: bool m_hasFailed; QHash<QString,QString> aliases; + QHash<QString,QString> redirects; QTcpServer server; }; diff --git a/tests/auto/declarative/states/data/anchorChanges.qml b/tests/auto/declarative/states/data/anchorChanges.qml index 3d94f36..7dce889 100644 --- a/tests/auto/declarative/states/data/anchorChanges.qml +++ b/tests/auto/declarative/states/data/anchorChanges.qml @@ -1,7 +1,7 @@ import Qt 4.6 Rectangle { - id: Container + id: container width: 200; height: 200 Rectangle { id: myRect @@ -14,10 +14,10 @@ Rectangle { states: State { name: "right" AnchorChanges { - id: AncCh + id: ancCh target: myRect; reset: "left" - right: Container.right + right: container.right } } } diff --git a/tests/auto/declarative/states/data/anchorChanges2.qml b/tests/auto/declarative/states/data/anchorChanges2.qml index 2e13628..516ed58 100644 --- a/tests/auto/declarative/states/data/anchorChanges2.qml +++ b/tests/auto/declarative/states/data/anchorChanges2.qml @@ -3,8 +3,8 @@ import Qt 4.6 Rectangle { width: 200; height: 200 Rectangle { - id: MyRect - objectName: "MyRect" + id: myRect + objectName: "myRect" width: 50; height: 50 color: "green"; anchors.left: parent.left @@ -13,7 +13,7 @@ Rectangle { states: State { name: "right" AnchorChanges { - target: MyRect; + target: myRect; reset: "left" right: parent.right } diff --git a/tests/auto/declarative/states/data/anchorChanges3.qml b/tests/auto/declarative/states/data/anchorChanges3.qml index cf85472..e19bd9a 100644 --- a/tests/auto/declarative/states/data/anchorChanges3.qml +++ b/tests/auto/declarative/states/data/anchorChanges3.qml @@ -1,29 +1,29 @@ import Qt 4.6 Rectangle { - id: Container + id: container width: 200; height: 200 Rectangle { - id: MyRect - objectName: "MyRect" + id: myRect + objectName: "myRect" color: "green"; anchors.left: parent.left - anchors.right: RightGuideline.left - anchors.top: TopGuideline.top - anchors.bottom: Container.bottom + anchors.right: rightGuideline.left + anchors.top: topGuideline.top + anchors.bottom: container.bottom } - Item { objectName: "LeftGuideline"; id: LeftGuideline; x: 10 } - Item { id: RightGuideline; x: 150 } - Item { id: TopGuideline; y: 10 } - Item { objectName: "BottomGuideline"; id: BottomGuideline; y: 150 } + Item { objectName: "leftGuideline"; id: leftGuideline; x: 10 } + Item { id: rightGuideline; x: 150 } + Item { id: topGuideline; y: 10 } + Item { objectName: "bottomGuideline"; id: bottomGuideline; y: 150 } states: State { name: "reanchored" AnchorChanges { - target: MyRect; - left: LeftGuideline.left - right: Container.right - top: Container.top - bottom: BottomGuideline.bottom + target: myRect; + left: leftGuideline.left + right: container.right + top: container.top + bottom: bottomGuideline.bottom } } } diff --git a/tests/auto/declarative/states/data/anchorChanges4.qml b/tests/auto/declarative/states/data/anchorChanges4.qml index 717f506..b766c71 100644 --- a/tests/auto/declarative/states/data/anchorChanges4.qml +++ b/tests/auto/declarative/states/data/anchorChanges4.qml @@ -3,20 +3,20 @@ import Qt 4.6 Rectangle { width: 200; height: 200 Rectangle { - id: MyRect - objectName: "MyRect" + id: myRect + objectName: "myRect" color: "green"; anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter } - Item { objectName: "LeftGuideline"; id: LeftGuideline; x: 10 } - Item { objectName: "BottomGuideline"; id: BottomGuideline; y: 150 } + Item { objectName: "leftGuideline"; id: leftGuideline; x: 10 } + Item { objectName: "bottomGuideline"; id: bottomGuideline; y: 150 } states: State { name: "reanchored" AnchorChanges { - target: MyRect; - horizontalCenter: BottomGuideline.horizontalCenter - verticalCenter: LeftGuideline.verticalCenter + target: myRect; + horizontalCenter: bottomGuideline.horizontalCenter + verticalCenter: leftGuideline.verticalCenter } } } diff --git a/tests/auto/declarative/states/data/anchorChanges5.qml b/tests/auto/declarative/states/data/anchorChanges5.qml index ef5f041..2d4b3c0 100644 --- a/tests/auto/declarative/states/data/anchorChanges5.qml +++ b/tests/auto/declarative/states/data/anchorChanges5.qml @@ -3,20 +3,20 @@ import Qt 4.6 Rectangle { width: 200; height: 200 Rectangle { - id: MyRect - objectName: "MyRect" + id: myRect + objectName: "myRect" color: "green"; anchors.horizontalCenter: parent.horizontalCenter anchors.baseline: parent.baseline } - Item { objectName: "LeftGuideline"; id: LeftGuideline; x: 10 } - Item { objectName: "BottomGuideline"; id: BottomGuideline; y: 150 } + Item { objectName: "leftGuideline"; id: leftGuideline; x: 10 } + Item { objectName: "bottomGuideline"; id: bottomGuideline; y: 150 } states: State { name: "reanchored" AnchorChanges { - target: MyRect; - horizontalCenter: BottomGuideline.horizontalCenter - baseline: LeftGuideline.baseline + target: myRect; + horizontalCenter: bottomGuideline.horizontalCenter + baseline: leftGuideline.baseline } } } diff --git a/tests/auto/declarative/states/data/basicBinding.qml b/tests/auto/declarative/states/data/basicBinding.qml index 930a6b2..6528113 100644 --- a/tests/auto/declarative/states/data/basicBinding.qml +++ b/tests/auto/declarative/states/data/basicBinding.qml @@ -1,12 +1,12 @@ import Qt 4.6 Rectangle { - id: MyRectangle + id: myRectangle property color sourceColor: "blue" width: 100; height: 100 color: "red" states: State { name: "blue" - PropertyChanges { target: MyRectangle; color: sourceColor } + PropertyChanges { target: myRectangle; color: sourceColor } } } diff --git a/tests/auto/declarative/states/data/basicBinding2.qml b/tests/auto/declarative/states/data/basicBinding2.qml index 6bfaf5a..2e7b4cf 100644 --- a/tests/auto/declarative/states/data/basicBinding2.qml +++ b/tests/auto/declarative/states/data/basicBinding2.qml @@ -1,12 +1,12 @@ import Qt 4.6 Rectangle { - id: MyRectangle + id: myRectangle property color sourceColor: "red" width: 100; height: 100 color: sourceColor states: State { name: "blue" - PropertyChanges { target: MyRectangle; color: "blue" } + PropertyChanges { target: myRectangle; color: "blue" } } -}
\ No newline at end of file +} diff --git a/tests/auto/declarative/states/data/basicBinding3.qml b/tests/auto/declarative/states/data/basicBinding3.qml index 344bfae..a3c47d9 100644 --- a/tests/auto/declarative/states/data/basicBinding3.qml +++ b/tests/auto/declarative/states/data/basicBinding3.qml @@ -1,6 +1,6 @@ import Qt 4.6 Rectangle { - id: MyRectangle + id: myRectangle property color sourceColor: "red" property color sourceColor2: "blue" @@ -8,6 +8,6 @@ Rectangle { color: sourceColor states: State { name: "blue" - PropertyChanges { target: MyRectangle; color: sourceColor2 } + PropertyChanges { target: myRectangle; color: sourceColor2 } } -}
\ No newline at end of file +} diff --git a/tests/auto/declarative/states/data/basicBinding4.qml b/tests/auto/declarative/states/data/basicBinding4.qml index f0b72bd..1f52d0e 100644 --- a/tests/auto/declarative/states/data/basicBinding4.qml +++ b/tests/auto/declarative/states/data/basicBinding4.qml @@ -1,6 +1,6 @@ import Qt 4.6 Rectangle { - id: MyRectangle + id: myRectangle property color sourceColor: "blue" width: 100; height: 100 @@ -8,10 +8,10 @@ Rectangle { states: [ State { name: "blue" - PropertyChanges { target: MyRectangle; color: sourceColor } + PropertyChanges { target: myRectangle; color: sourceColor } }, State { name: "green" - PropertyChanges { target: MyRectangle; color: "green" } + PropertyChanges { target: myRectangle; color: "green" } }] } diff --git a/tests/auto/declarative/states/data/basicChanges.qml b/tests/auto/declarative/states/data/basicChanges.qml index 8d560c6..88ea256 100644 --- a/tests/auto/declarative/states/data/basicChanges.qml +++ b/tests/auto/declarative/states/data/basicChanges.qml @@ -1,10 +1,10 @@ import Qt 4.6 Rectangle { - id: MyRectangle + id: myRectangle width: 100; height: 100 color: "red" states: State { name: "blue" - PropertyChanges { target: MyRectangle; color: "blue" } + PropertyChanges { target: myRectangle; color: "blue" } } -}
\ No newline at end of file +} diff --git a/tests/auto/declarative/states/data/basicChanges2.qml b/tests/auto/declarative/states/data/basicChanges2.qml index 0f8783a..4dd293f 100644 --- a/tests/auto/declarative/states/data/basicChanges2.qml +++ b/tests/auto/declarative/states/data/basicChanges2.qml @@ -1,15 +1,15 @@ import Qt 4.6 Rectangle { - id: MyRectangle + id: myRectangle width: 100; height: 100 color: "red" states: [ State { name: "blue" - PropertyChanges { target: MyRectangle; color: "blue" } + PropertyChanges { target: myRectangle; color: "blue" } }, State { name: "green" - PropertyChanges { target: MyRectangle; color: "green" } + PropertyChanges { target: myRectangle; color: "green" } }] -}
\ No newline at end of file +} diff --git a/tests/auto/declarative/states/data/basicChanges3.qml b/tests/auto/declarative/states/data/basicChanges3.qml index 2a5ca5d..62ab1d5 100644 --- a/tests/auto/declarative/states/data/basicChanges3.qml +++ b/tests/auto/declarative/states/data/basicChanges3.qml @@ -1,15 +1,15 @@ import Qt 4.6 Rectangle { - id: MyRectangle + id: myRectangle width: 100; height: 100 color: "red" states: [ State { name: "blue" - PropertyChanges { target: MyRectangle; color: "blue" } + PropertyChanges { target: myRectangle; color: "blue" } }, State { name: "bordered" - PropertyChanges { target: MyRectangle; border.width: 2 } + PropertyChanges { target: myRectangle; border.width: 2 } }] } diff --git a/tests/auto/declarative/states/data/basicExtension.qml b/tests/auto/declarative/states/data/basicExtension.qml index 230e00b..1836f8a 100644 --- a/tests/auto/declarative/states/data/basicExtension.qml +++ b/tests/auto/declarative/states/data/basicExtension.qml @@ -1,16 +1,16 @@ import Qt 4.6 Rectangle { - id: MyRectangle + id: myRectangle width: 100; height: 100 color: "red" states: [ State { name: "blue" - PropertyChanges { target: MyRectangle; color: "blue" } + PropertyChanges { target: myRectangle; color: "blue" } }, State { name: "bordered" extend: "blue" - PropertyChanges { target: MyRectangle; border.width: 2 } + PropertyChanges { target: myRectangle; border.width: 2 } }] -}
\ No newline at end of file +} diff --git a/tests/auto/declarative/states/data/deleting.qml b/tests/auto/declarative/states/data/deleting.qml index 0c512dd..3da0b12 100644 --- a/tests/auto/declarative/states/data/deleting.qml +++ b/tests/auto/declarative/states/data/deleting.qml @@ -1,11 +1,11 @@ import Qt 4.6 Rectangle { - id: MyRectangle + id: myRectangle width: 100; height: 100 color: "red" states: State { name: "blue" - PropertyChanges { target: MyRectangle; color: "blue"; objectName: "pc1" } - PropertyChanges { target: MyRectangle; radius: 5; objectName: "pc2" } + PropertyChanges { target: myRectangle; color: "blue"; objectName: "pc1" } + PropertyChanges { target: myRectangle; radius: 5; objectName: "pc2" } } } diff --git a/tests/auto/declarative/states/data/deletingState.qml b/tests/auto/declarative/states/data/deletingState.qml index 9dc46a6..a5e8ed3 100644 --- a/tests/auto/declarative/states/data/deletingState.qml +++ b/tests/auto/declarative/states/data/deletingState.qml @@ -1,13 +1,13 @@ import Qt 4.6 Rectangle { - id: MyRectangle + id: myRectangle width: 100; height: 100 color: "red" StateGroup { id: stateGroup states: State { name: "blue" - PropertyChanges { target: MyRectangle; color: "blue" } + PropertyChanges { target: myRectangle; color: "blue" } } } } diff --git a/tests/auto/declarative/states/data/explicit.qml b/tests/auto/declarative/states/data/explicit.qml index ca7e274..7543f84 100644 --- a/tests/auto/declarative/states/data/explicit.qml +++ b/tests/auto/declarative/states/data/explicit.qml @@ -1,6 +1,6 @@ import Qt 4.6 Rectangle { - id: MyRectangle + id: myRectangle property color sourceColor: "blue" width: 100; height: 100 color: "red" @@ -8,7 +8,7 @@ Rectangle { name: "blue" PropertyChanges { objectName: "changes" - target: MyRectangle; explicit: true + target: myRectangle; explicit: true color: sourceColor } } diff --git a/tests/auto/declarative/states/data/fakeExtension.qml b/tests/auto/declarative/states/data/fakeExtension.qml index 3d85c4f..c7975e1 100644 --- a/tests/auto/declarative/states/data/fakeExtension.qml +++ b/tests/auto/declarative/states/data/fakeExtension.qml @@ -1,16 +1,16 @@ import Qt 4.6 Rectangle { - id: MyRectangle + id: myRectangle width: 100; height: 100 color: "red" states: [ State { name: "blue" - PropertyChanges { target: MyRectangle; color: "blue" } + PropertyChanges { target: myRectangle; color: "blue" } }, State { name: "green" extend: "blue" - PropertyChanges { target: MyRectangle; color: "green" } + PropertyChanges { target: myRectangle; color: "green" } }] -}
\ No newline at end of file +} diff --git a/tests/auto/declarative/states/data/nonExistantProp.qml b/tests/auto/declarative/states/data/nonExistantProp.qml index 582029d..a5dd86a 100644 --- a/tests/auto/declarative/states/data/nonExistantProp.qml +++ b/tests/auto/declarative/states/data/nonExistantProp.qml @@ -1,11 +1,11 @@ import Qt 4.6 Rectangle { - id: MyRectangle + id: myRectangle width: 100; height: 100 color: "red" states: State { name: "blue" - PropertyChanges { target: MyRectangle; colr: "blue" } + PropertyChanges { target: myRectangle; colr: "blue" } } } diff --git a/tests/auto/declarative/states/data/parentChange.qml b/tests/auto/declarative/states/data/parentChange.qml index 29596a8..087da6b 100644 --- a/tests/auto/declarative/states/data/parentChange.qml +++ b/tests/auto/declarative/states/data/parentChange.qml @@ -13,7 +13,7 @@ Rectangle { } } MouseRegion { - id: Clickable + id: clickable anchors.fill: parent } @@ -28,7 +28,7 @@ Rectangle { states: State { name: "reparented" - when: Clickable.pressed + when: clickable.pressed ParentChange { target: myRect parent: newParent diff --git a/tests/auto/declarative/states/data/parentChange2.qml b/tests/auto/declarative/states/data/parentChange2.qml index d1c6d6a..f0b00f5 100644 --- a/tests/auto/declarative/states/data/parentChange2.qml +++ b/tests/auto/declarative/states/data/parentChange2.qml @@ -16,13 +16,13 @@ Rectangle { } } MouseRegion { - id: Clickable + id: clickable anchors.fill: parent } states: State { name: "reparented" - when: Clickable.pressed + when: clickable.pressed ParentChange { target: myRect parent: newParent diff --git a/tests/auto/declarative/states/data/parentChange3.qml b/tests/auto/declarative/states/data/parentChange3.qml index c7b7bee..2aa507c 100644 --- a/tests/auto/declarative/states/data/parentChange3.qml +++ b/tests/auto/declarative/states/data/parentChange3.qml @@ -17,7 +17,7 @@ Rectangle { } } MouseRegion { - id: Clickable + id: clickable anchors.fill: parent } @@ -33,7 +33,7 @@ Rectangle { states: State { name: "reparented" - when: Clickable.pressed + when: clickable.pressed ParentChange { target: myRect parent: newParent diff --git a/tests/auto/declarative/states/data/parentChange4.qml b/tests/auto/declarative/states/data/parentChange4.qml index ee75176..d00274b 100644 --- a/tests/auto/declarative/states/data/parentChange4.qml +++ b/tests/auto/declarative/states/data/parentChange4.qml @@ -10,7 +10,7 @@ Rectangle { color: "red" } MouseRegion { - id: Clickable + id: clickable anchors.fill: parent } @@ -21,7 +21,7 @@ Rectangle { states: State { name: "reparented" - when: Clickable.pressed + when: clickable.pressed ParentChange { target: myRect parent: newParent diff --git a/tests/auto/declarative/states/data/parentChange5.qml b/tests/auto/declarative/states/data/parentChange5.qml index 47b733b..f75e2a3 100644 --- a/tests/auto/declarative/states/data/parentChange5.qml +++ b/tests/auto/declarative/states/data/parentChange5.qml @@ -10,7 +10,7 @@ Rectangle { color: "red" } MouseRegion { - id: Clickable + id: clickable anchors.fill: parent } @@ -21,7 +21,7 @@ Rectangle { states: State { name: "reparented" - when: Clickable.pressed + when: clickable.pressed ParentChange { target: myRect parent: newParent diff --git a/tests/auto/declarative/states/data/propertyErrors.qml b/tests/auto/declarative/states/data/propertyErrors.qml index 270462e..080e833 100644 --- a/tests/auto/declarative/states/data/propertyErrors.qml +++ b/tests/auto/declarative/states/data/propertyErrors.qml @@ -1,10 +1,10 @@ import Qt 4.6 Rectangle { - id: MyRectangle + id: myRectangle width: 100; height: 100 color: "red" states: State { name: "blue" - PropertyChanges { target: MyRectangle; colr: "blue"; wantsFocus: true } + PropertyChanges { target: myRectangle; colr: "blue"; wantsFocus: true } } } diff --git a/tests/auto/declarative/states/data/restoreEntryValues.qml b/tests/auto/declarative/states/data/restoreEntryValues.qml index d86f033..088c608 100644 --- a/tests/auto/declarative/states/data/restoreEntryValues.qml +++ b/tests/auto/declarative/states/data/restoreEntryValues.qml @@ -1,12 +1,12 @@ import Qt 4.6 Rectangle { - id: MyRectangle + id: myRectangle width: 100; height: 100 color: "red" states: State { name: "blue" PropertyChanges { - target: MyRectangle + target: myRectangle restoreEntryValues: false color: "blue" } diff --git a/tests/auto/declarative/states/data/script.qml b/tests/auto/declarative/states/data/script.qml index 6983419..3c5f33e 100644 --- a/tests/auto/declarative/states/data/script.qml +++ b/tests/auto/declarative/states/data/script.qml @@ -1,10 +1,10 @@ import Qt 4.6 Rectangle { - id: MyRectangle + id: myRectangle width: 100; height: 100 color: "red" states: State { name: "blue" - StateChangeScript { script: MyRectangle.color = "blue"; } + StateChangeScript { script: myRectangle.color = "blue"; } } } diff --git a/tests/auto/declarative/visual/ListView/basic1.qml b/tests/auto/declarative/visual/ListView/basic1.qml index 85934dc..3c371a6 100644 --- a/tests/auto/declarative/visual/ListView/basic1.qml +++ b/tests/auto/declarative/visual/ListView/basic1.qml @@ -4,7 +4,7 @@ Rectangle { color: "blue" width: 200 height: 300 - id: Page + id: page ListView { anchors.fill: parent delegate: Rectangle { diff --git a/tests/auto/declarative/visual/ListView/basic2.qml b/tests/auto/declarative/visual/ListView/basic2.qml index 4fe63ac..bdba65e 100644 --- a/tests/auto/declarative/visual/ListView/basic2.qml +++ b/tests/auto/declarative/visual/ListView/basic2.qml @@ -4,9 +4,9 @@ Rectangle { color: "blue" width: 200 height: 300 - id: Page + id: page Component { - id: Delegate + id: delegate Rectangle { color: "red" width: 100 @@ -18,7 +18,7 @@ Rectangle { } ListView { anchors.fill: parent - delegate: Delegate + delegate: delegate model: ListModel { ListElement { name: "January" diff --git a/tests/auto/declarative/visual/ListView/basic3.qml b/tests/auto/declarative/visual/ListView/basic3.qml index c0705e9..05ac358 100644 --- a/tests/auto/declarative/visual/ListView/basic3.qml +++ b/tests/auto/declarative/visual/ListView/basic3.qml @@ -4,9 +4,9 @@ Rectangle { color: "blue" width: 200 height: 300 - id: Page - ListModel { - id: Model + id: page + Listmodel { + id: model ListElement { name: "January" } @@ -16,7 +16,7 @@ Rectangle { } ListView { anchors.fill: parent - model: Model + model: model delegate: Rectangle { color: "red" width: 100 diff --git a/tests/auto/declarative/visual/ListView/basic4.qml b/tests/auto/declarative/visual/ListView/basic4.qml index c8e1bcc..3628bd3 100644 --- a/tests/auto/declarative/visual/ListView/basic4.qml +++ b/tests/auto/declarative/visual/ListView/basic4.qml @@ -4,9 +4,9 @@ Rectangle { color: "blue" width: 200 height: 300 - id: Page - ListModel { - id: Model + id: page + Listmodel { + id: model ListElement { name: "January" } @@ -15,7 +15,7 @@ Rectangle { } } Component { - id: Delegate + id: delegate Rectangle { color: "red" width: 100 @@ -27,7 +27,7 @@ Rectangle { } ListView { anchors.fill: parent - model: Model - delegate: Delegate + model: model + delegate: delegate } } diff --git a/tests/auto/declarative/visual/Package_Views/packageviews.qml b/tests/auto/declarative/visual/Package_Views/packageviews.qml index ece6b88..c8016b6 100644 --- a/tests/auto/declarative/visual/Package_Views/packageviews.qml +++ b/tests/auto/declarative/visual/Package_Views/packageviews.qml @@ -6,9 +6,9 @@ Rectangle { height: 200 color: "black" - VisualDataModel { - id: Model - model: ListModel { + VisualDatamodel { + id: model + model: Listmodel { ListElement { itemColor: "red" } ListElement { itemColor: "green" } ListElement { itemColor: "blue" } @@ -75,7 +75,7 @@ Rectangle { ListView { width: parent.width/2 height: parent.height - model: Model.parts.list + model: model.parts.list } GridView { @@ -84,6 +84,6 @@ Rectangle { cellWidth: 50 cellHeight: 50 height: parent.height - model: Model.parts.grid + model: model.parts.grid } } diff --git a/tests/auto/declarative/visual/animation/bindinganimation/bindinganimation.qml b/tests/auto/declarative/visual/animation/bindinganimation/bindinganimation.qml index 1afd4cd..732eb59 100644 --- a/tests/auto/declarative/visual/animation/bindinganimation/bindinganimation.qml +++ b/tests/auto/declarative/visual/animation/bindinganimation/bindinganimation.qml @@ -4,9 +4,9 @@ Rectangle { color: "blue" width: 320 height: 240 - id: Page + id: page Rectangle { - id: MyRectangle + id: myRectangle width: 100 height: 100 color: "red" @@ -16,12 +16,12 @@ Rectangle { State { name: "hello" PropertyChanges { - target: MyRectangle + target: myRectangle x: 50 + 50 } PropertyChanges { - target: MyMouseRegion - onClicked: Page.state = '' + target: myMouseRegion + onClicked: page.state = '' } } ] @@ -33,8 +33,8 @@ Rectangle { } ] MouseRegion { - id: MyMouseRegion + id: myMouseRegion anchors.fill: parent - onClicked: { Page.state= 'hello' } + onClicked: { page.state= 'hello' } } } diff --git a/tests/auto/declarative/visual/animation/parentAction/parentAction.qml b/tests/auto/declarative/visual/animation/parentAction/parentAction.qml index e69d234..1e3f402 100644 --- a/tests/auto/declarative/visual/animation/parentAction/parentAction.qml +++ b/tests/auto/declarative/visual/animation/parentAction/parentAction.qml @@ -8,7 +8,7 @@ Rectangle { transformOrigin: "Center" x: 10; y: 10 Rectangle { - id: MyRect + id: myRect x: 5 width: 100; height: 100 transformOrigin: "BottomLeft" @@ -16,7 +16,7 @@ Rectangle { } } MouseRegion { - id: Clickable + id: clickable anchors.fill: parent } @@ -32,13 +32,13 @@ Rectangle { states: State { name: "moved" - when: Clickable.pressed + when: clickable.pressed ParentChange { - target: MyRect + target: myRect parent: newParent } PropertyChanges { - target: MyRect + target: myRect rotation: -52 scale: 1 color: "blue" diff --git a/tests/auto/declarative/visual/animation/propertyAction/propertyAction.qml b/tests/auto/declarative/visual/animation/propertyAction/propertyAction.qml index a9d3c74..b670166 100644 --- a/tests/auto/declarative/visual/animation/propertyAction/propertyAction.qml +++ b/tests/auto/declarative/visual/animation/propertyAction/propertyAction.qml @@ -3,20 +3,20 @@ import Qt 4.6 Rectangle { width: 400; height: 400 Rectangle { - id: MyRect + id: myRect width: 100; height: 100 color: "red" } MouseRegion { - id: Clickable + id: clickable anchors.fill: parent } states: State { name: "state1" - when: Clickable.pressed + when: clickable.pressed PropertyChanges { - target: MyRect + target: myRect x: 50; y: 50 color: "blue" } diff --git a/tests/auto/declarative/visual/focusscope/test.qml b/tests/auto/declarative/visual/focusscope/test.qml index dd6d726..401c7dc 100644 --- a/tests/auto/declarative/visual/focusscope/test.qml +++ b/tests/auto/declarative/visual/focusscope/test.qml @@ -8,7 +8,7 @@ Rectangle { Keys.onDigit9Pressed: console.log("Error - Root") FocusScope { - id: MyScope + id: myScope focus: true Keys.onDigit9Pressed: console.log("Error - FocusScope") @@ -19,16 +19,16 @@ Rectangle { color: "transparent" border.width: 5 - border.color: MyScope.wantsFocus?"blue":"black" + border.color: myScope.wantsFocus?"blue":"black" Rectangle { - id: Item1 + id: item1 x: 10; y: 10 width: 100; height: 100; color: "green" border.width: 5 border.color: wantsFocus?"blue":"black" Keys.onDigit9Pressed: console.log("Top Left"); - KeyNavigation.right: Item2 + KeyNavigation.right: item2 focus: true Rectangle { @@ -38,12 +38,12 @@ Rectangle { } Rectangle { - id: Item2 + id: item2 x: 310; y: 10 width: 100; height: 100; color: "green" border.width: 5 border.color: wantsFocus?"blue":"black" - KeyNavigation.left: Item1 + KeyNavigation.left: item1 Keys.onDigit9Pressed: console.log("Top Right"); Rectangle { @@ -52,20 +52,20 @@ Rectangle { } } } - KeyNavigation.down: Item3 + KeyNavigation.down: item3 } Text { x:100; y:170; text: "Blue border indicates scoped focus\nBlack border indicates NOT scoped focus\nRed box indicates active focus\nUse arrow keys to navigate\nPress \"9\" to print currently focused item" } Rectangle { - id: Item3 + id: item3 x: 10; y: 300 width: 100; height: 100; color: "green" border.width: 5 border.color: wantsFocus?"blue":"black" Keys.onDigit9Pressed: console.log("Bottom Left"); - KeyNavigation.up: MyScope + KeyNavigation.up: myScope Rectangle { width: 50; height: 50; anchors.centerIn: parent diff --git a/tests/auto/declarative/visual/focusscope/test3.qml b/tests/auto/declarative/visual/focusscope/test3.qml index 4be9dc7..855bdc5 100644 --- a/tests/auto/declarative/visual/focusscope/test3.qml +++ b/tests/auto/declarative/visual/focusscope/test3.qml @@ -5,8 +5,8 @@ Rectangle { width: 800 height: 600 - ListModel { - id: Model + Listmodel { + id: model ListElement { name: "1" } ListElement { name: "2" } ListElement { name: "3" } @@ -19,16 +19,16 @@ Rectangle { } Component { - id: VerticalDelegate + id: verticalDelegate FocusScope { - id: Root + id: root width: 50; height: 50; Keys.onDigit9Pressed: console.log("Error - " + name) Rectangle { focus: true Keys.onDigit9Pressed: console.log(name) width: 50; height: 50; - color: Root.ListView.isCurrentItem?"red":"green" + color: root.ListView.isCurrentItem?"red":"green" Text { text: name; anchors.centerIn: parent } } } @@ -37,8 +37,8 @@ Rectangle { ListView { width: 800; height: 50; orientation: "Horizontal" focus: true - model: Model - delegate: VerticalDelegate + model: model + delegate: verticalDelegate preferredHighlightBegin: 100 preferredHighlightEnd: 101 highlightRangeMode: ListView.StrictlyEnforceRange diff --git a/tests/auto/declarative/visual/qmlgraphicsflickable/flickable-vertical.qml b/tests/auto/declarative/visual/qmlgraphicsflickable/flickable-vertical.qml index e9aae61..cc15755 100644 --- a/tests/auto/declarative/visual/qmlgraphicsflickable/flickable-vertical.qml +++ b/tests/auto/declarative/visual/qmlgraphicsflickable/flickable-vertical.qml @@ -15,8 +15,8 @@ Rectangle { ListElement { dayColor: "orange" } } - Flickable { - id: Flick + flickable { + id: flick height: parent.height-50 width: parent.width; viewportHeight: column.height @@ -37,10 +37,10 @@ Rectangle { } Rectangle { radius: 3 - x: Flick.width-8 + x: flick.width-8 width: 8 - y: Flick.visibleArea.yPosition * Flick.height - height: Flick.visibleArea.heightRatio * Flick.height + y: flick.visibleArea.yPosition * flick.height + height: flick.visibleArea.heightRatio * flick.height } // click to toggle interactive flag @@ -51,7 +51,7 @@ Rectangle { color: "red" MouseRegion { anchors.fill: parent - onClicked: Flick.interactive = Flick.interactive ? false : true + onClicked: flick.interactive = flick.interactive ? false : true } } @@ -64,7 +64,7 @@ Rectangle { color: "green" MouseRegion { anchors.fill: parent - onClicked: Flick.pressDelay = Flick.pressDelay > 0 ? 0 : 500 + onClicked: flick.pressDelay = flick.pressDelay > 0 ? 0 : 500 } } @@ -77,12 +77,12 @@ Rectangle { color: "yellow" MouseRegion { anchors.fill: parent - onClicked: Flick.overShoot = Flick.overShoot > 0 ? 0 : 30 + onClicked: flick.overShoot = flick.overShoot > 0 ? 0 : 30 } } Rectangle { - width: Math.abs(Flick.verticalVelocity)/100 + width: Math.abs(flick.verticalVelocity)/100 height: 50 x: 200 y: parent.height - 50 diff --git a/tests/auto/declarative/visual/qmlgraphicstextedit/qt-669.qml b/tests/auto/declarative/visual/qmlgraphicstextedit/qt-669.qml index e37f1b2..b01ddf8 100644 --- a/tests/auto/declarative/visual/qmlgraphicstextedit/qt-669.qml +++ b/tests/auto/declarative/visual/qmlgraphicstextedit/qt-669.qml @@ -1,7 +1,7 @@ import Qt 4.6 Rectangle { - Component { id: TestableCursor + Component { id: testableCursor //Doesn't blink Rectangle { color:"black" @@ -13,7 +13,7 @@ Rectangle { height:40; TextEdit { focus: true; - cursorDelegate: TestableCursor + cursorDelegate: testableCursor text: "Jackdaws love my big sphinx of Quartz" } } diff --git a/tests/auto/declarative/xmlhttprequest/data/redirectError.qml b/tests/auto/declarative/xmlhttprequest/data/redirectError.qml new file mode 100644 index 0000000..6b345cc --- /dev/null +++ b/tests/auto/declarative/xmlhttprequest/data/redirectError.qml @@ -0,0 +1,23 @@ +import Qt 4.6 + +QtObject { + property string url + + property bool dataOK: false + property bool done: false + + Component.onCompleted: { + var x = new XMLHttpRequest; + x.open("GET", url); + + x.onreadystatechange = function() { + if (x.readyState == XMLHttpRequest.DONE) { + done = true; + dataOK = x.status == 404; + } + } + + x.send(); + } +} + diff --git a/tests/auto/declarative/xmlhttprequest/data/redirectRecur.qml b/tests/auto/declarative/xmlhttprequest/data/redirectRecur.qml new file mode 100644 index 0000000..c0321dc --- /dev/null +++ b/tests/auto/declarative/xmlhttprequest/data/redirectRecur.qml @@ -0,0 +1,23 @@ +import Qt 4.6 + +QtObject { + property string url + + property bool dataOK: false + property bool done: false + + Component.onCompleted: { + var x = new XMLHttpRequest; + x.open("GET", url); + + x.onreadystatechange = function() { + if (x.readyState == XMLHttpRequest.DONE) { + done = true; + dataOK = x.status == 302; + } + } + + x.send(); + } +} + diff --git a/tests/auto/declarative/xmlhttprequest/data/redirects.qml b/tests/auto/declarative/xmlhttprequest/data/redirects.qml new file mode 100644 index 0000000..f6fabdb --- /dev/null +++ b/tests/auto/declarative/xmlhttprequest/data/redirects.qml @@ -0,0 +1,22 @@ +import Qt 4.6 + +QtObject { + property string url + + property bool dataOK: false + property bool done: false + + Component.onCompleted: { + var x = new XMLHttpRequest; + x.open("GET", url); + + x.onreadystatechange = function() { + if (x.readyState == XMLHttpRequest.DONE) { + done = true; + dataOK = x.responseText == "Redirected\n"; + } + } + + x.send(); + } +} diff --git a/tests/auto/declarative/xmlhttprequest/data/redirecttarget.html b/tests/auto/declarative/xmlhttprequest/data/redirecttarget.html new file mode 100644 index 0000000..95f35e0 --- /dev/null +++ b/tests/auto/declarative/xmlhttprequest/data/redirecttarget.html @@ -0,0 +1 @@ +Redirected diff --git a/tests/auto/declarative/xmlhttprequest/tst_xmlhttprequest.cpp b/tests/auto/declarative/xmlhttprequest/tst_xmlhttprequest.cpp index d3201e2..253e041 100644 --- a/tests/auto/declarative/xmlhttprequest/tst_xmlhttprequest.cpp +++ b/tests/auto/declarative/xmlhttprequest/tst_xmlhttprequest.cpp @@ -98,6 +98,7 @@ private slots: void responseText(); void responseXML_invalid(); void invalidMethodUsage(); + void redirects(); // Attributes void document(); @@ -1160,6 +1161,72 @@ void tst_xmlhttprequest::invalidMethodUsage() delete object; } +// Test that XMLHttpRequest transparently redirects +void tst_xmlhttprequest::redirects() +{ + { + TestHTTPServer server(SERVER_PORT); + QVERIFY(server.isValid()); + server.addRedirect("redirect.html", "http://127.0.0.1:14445/redirecttarget.html"); + server.serveDirectory("data"); + + QmlComponent component(&engine, TEST_FILE("redirects.qml")); + QObject *object = component.beginCreate(engine.rootContext()); + QVERIFY(object != 0); + object->setProperty("url", "http://127.0.0.1:14445/redirect.html"); + object->setProperty("expectedText", ""); + component.completeCreate(); + + TRY_WAIT(object->property("done").toBool() == true); + QCOMPARE(object->property("dataOK").toBool(), true); + + delete object; + } + + { + TestHTTPServer server(SERVER_PORT); + QVERIFY(server.isValid()); + server.addRedirect("redirect.html", "http://127.0.0.1:14445/redirectmissing.html"); + server.serveDirectory("data"); + + QmlComponent component(&engine, TEST_FILE("redirectError.qml")); + QObject *object = component.beginCreate(engine.rootContext()); + QVERIFY(object != 0); + object->setProperty("url", "http://127.0.0.1:14445/redirect.html"); + object->setProperty("expectedText", ""); + component.completeCreate(); + + TRY_WAIT(object->property("done").toBool() == true); + QCOMPARE(object->property("dataOK").toBool(), true); + + delete object; + } + + { + TestHTTPServer server(SERVER_PORT); + QVERIFY(server.isValid()); + server.addRedirect("redirect.html", "http://127.0.0.1:14445/redirect.html"); + server.serveDirectory("data"); + + QmlComponent component(&engine, TEST_FILE("redirectRecur.qml")); + QObject *object = component.beginCreate(engine.rootContext()); + QVERIFY(object != 0); + object->setProperty("url", "http://127.0.0.1:14445/redirect.html"); + object->setProperty("expectedText", ""); + component.completeCreate(); + + for (int ii = 0; ii < 60; ++ii) { + if (object->property("done").toBool()) break; + QTest::qWait(50); + } + QVERIFY(object->property("done").toBool() == true); + + QCOMPARE(object->property("dataOK").toBool(), true); + + delete object; + } +} + void tst_xmlhttprequest::responseXML_invalid() { QmlComponent component(&engine, TEST_FILE("responseXML_invalid.qml")); diff --git a/tests/auto/linguist/lupdate/.gitignore b/tests/auto/linguist/lupdate/.gitignore index 389f2dc..a11e8d1 100644 --- a/tests/auto/linguist/lupdate/.gitignore +++ b/tests/auto/linguist/lupdate/.gitignore @@ -1,4 +1,4 @@ tst_lupdate -testdata/good/*/project.ts -testdata/good/*/*/project.ts -testdata/recursivescan/*.ts +testdata/*/*.ts +testdata/*/*/*.ts +testdata/*/*/*/*.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/lupdatecmd new file mode 100644 index 0000000..301d839 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/lupdatecmd @@ -0,0 +1,2 @@ +cd ../../recursivescan +lupdate sub/finddialog.cpp -ts project.ts diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result b/tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/project.ts.result index 5c3c21c..5c3c21c 100644 --- a/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/cmdline_deeppath/project.ts.result diff --git a/tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/lupdatecmd new file mode 100644 index 0000000..1814e67 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/lupdatecmd @@ -0,0 +1,2 @@ +cd ../../recursivescan +lupdate . -ts project.ts diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result b/tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/project.ts.result index 95a34fa..95a34fa 100644 --- a/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/cmdline_recurse/project.ts.result diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr3/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/expectedoutput.txt new file mode 100644 index 0000000..feecdda --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/expectedoutput.txt @@ -0,0 +1 @@ +lupdate warning: Codec for tr\(\) 'ISO-8859-1' disagrees with existing file's codec 'UTF-8'\. Expect trouble\. diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr3/main.cpp b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/main.cpp new file mode 100644 index 0000000..e4210c5 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/main.cpp @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +int main(int argc, char **argv) +{ + QObject::tr("hi"); +} diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.pro b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.pro new file mode 100644 index 0000000..00a4dc4 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.pro @@ -0,0 +1,4 @@ +SOURCES += main.cpp + +TRANSLATIONS = project.ts +CODECFORTR = latin1 diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.ts.before b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.ts.before new file mode 100644 index 0000000..07ad79b --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.ts.before @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0"> +<defaultcodec>UTF-8</defaultcodec> +<context> + <name>QObject</name> + <message> + <location filename="main.cpp" line="44"/> + <source>hi</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.ts.result new file mode 100644 index 0000000..b6899c1 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr3/project.ts.result @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0"> +<context> + <name>QObject</name> + <message> + <location filename="main.cpp" line="44"/> + <source>hi</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr4/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/expectedoutput.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/expectedoutput.txt diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr4/main.cpp b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/main.cpp new file mode 100644 index 0000000..e4210c5 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/main.cpp @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +int main(int argc, char **argv) +{ + QObject::tr("hi"); +} diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.pro b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.pro new file mode 100644 index 0000000..4fddb02 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.pro @@ -0,0 +1,4 @@ +SOURCES += main.cpp + +TRANSLATIONS = project.ts +CODECFORTR = latin2 diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.ts.before b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.ts.before new file mode 100644 index 0000000..e18e34e --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.ts.before @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0"> +<defaultcodec>ISO-8859-2</defaultcodec> +<context> + <name>QObject</name> + <message> + <location filename="main.cpp" line="44"/> + <source>hi</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.ts.result new file mode 100644 index 0000000..e18e34e --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr4/project.ts.result @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0"> +<defaultcodec>ISO-8859-2</defaultcodec> +<context> + <name>QObject</name> + <message> + <location filename="main.cpp" line="44"/> + <source>hi</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/tests/auto/linguist/lupdate/testdata/good/from_subdir/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/from_subdir/lupdatecmd new file mode 100644 index 0000000..8a5b4ad --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/from_subdir/lupdatecmd @@ -0,0 +1 @@ +lupdate translations/translations.pro diff --git a/tests/auto/linguist/lupdate/testdata/good/from_subdir/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/from_subdir/project.ts.result new file mode 100644 index 0000000..7167cf3 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/from_subdir/project.ts.result @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0"> +<context> + <name>QApplication</name> + <message> + <location filename="src/main.cpp" line="49"/> + <source>string in main.cpp</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="src/main.h" line="45"/> + <source>string in main.h</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/tests/auto/linguist/lupdate/testdata/good/from_subdir/src/main.cpp b/tests/auto/linguist/lupdate/testdata/good/from_subdir/src/main.cpp new file mode 100644 index 0000000..1a24ab2 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/from_subdir/src/main.cpp @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// IMPORTANT!!!! If you want to add testdata to this file, +// always add it to the end in order to not change the linenumbers of translations!!! + +#include "main.h" + +int main(char **argv, int argc) +{ + return QApplication::tr("string in main.cpp"); +} diff --git a/tests/auto/linguist/lupdate/testdata/good/from_subdir/src/main.h b/tests/auto/linguist/lupdate/testdata/good/from_subdir/src/main.h new file mode 100644 index 0000000..cc07d7c --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/from_subdir/src/main.h @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// IMPORTANT!!!! If you want to add testdata to this file, +// always add it to the end in order to not change the linenumbers of translations!!! + +QT_TRANSLATE_NOOP("QApplication", "string in main.h") diff --git a/tests/auto/linguist/lupdate/testdata/good/from_subdir/translations/translations.pro b/tests/auto/linguist/lupdate/testdata/good/from_subdir/translations/translations.pro new file mode 100644 index 0000000..1815c37 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/from_subdir/translations/translations.pro @@ -0,0 +1,7 @@ +VPATH = ../src +INCLUDEPATH = ../src + +SOURCES += main.cpp +HEADERS += main.h + +TRANSLATIONS += ../project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/recurse_full/expectedoutput.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full/expectedoutput.txt diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/recurse_full/lupdatecmd new file mode 100644 index 0000000..40987e2 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full/lupdatecmd @@ -0,0 +1,2 @@ +TRANSLATION: project.ts project_sub.ts +cd ../../subdirs_full diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_full/project.ts.result new file mode 100644 index 0000000..7d9a6f4 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full/project.ts.result @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0"> +<context> + <name>subdir1</name> + <message> + <location filename="subdir1/main.cpp" line="45"/> + <source>minimal test</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>subsub1</name> + <message> + <location filename="subdir2/subsub1/main.cpp" line="45"/> + <source>minimal test</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full/project_sub.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_full/project_sub.ts.result new file mode 100644 index 0000000..cddb963 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full/project_sub.ts.result @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0"> +<defaultcodec>ISO-8859-2</defaultcodec> +<context> + <name>subsub2</name> + <message> + <location filename="subdir2/subsub2/main.cpp" line="45"/> + <source>minimal test</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/expectedoutput.txt new file mode 100644 index 0000000..fd7a158 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/expectedoutput.txt @@ -0,0 +1,2 @@ +lupdate warning: TS files from command line will override TRANSLATIONS in project\.pro\. +lupdate warning: TS files from command line prevent recursing into .*/subdir2/subsub2/subsub2\.pro\. diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/lupdatecmd new file mode 100644 index 0000000..33296c3 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/lupdatecmd @@ -0,0 +1,3 @@ +TRANSLATION: project.ts project_sub.ts +cd ../../subdirs_full +lupdate project.pro -ts project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project.ts.result new file mode 100644 index 0000000..7d9a6f4 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project.ts.result @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0"> +<context> + <name>subdir1</name> + <message> + <location filename="subdir1/main.cpp" line="45"/> + <source>minimal test</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>subsub1</name> + <message> + <location filename="subdir2/subsub1/main.cpp" line="45"/> + <source>minimal test</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project_sub.ts.before b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project_sub.ts.before new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project_sub.ts.before diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project_sub.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project_sub.ts.result new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts/project_sub.ts.result diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/expectedoutput.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/expectedoutput.txt diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/lupdatecmd new file mode 100644 index 0000000..628acc0 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/lupdatecmd @@ -0,0 +1,2 @@ +cd ../../subdirs_full +lupdate subdir1/subdir1.pro subdir2/subsub1/subsub1.pro -ts project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/project.ts.result new file mode 100644 index 0000000..7d9a6f4 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_full_ts_join/project.ts.result @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0"> +<context> + <name>subdir1</name> + <message> + <location filename="subdir1/main.cpp" line="45"/> + <source>minimal test</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>subsub1</name> + <message> + <location filename="subdir2/subsub1/main.cpp" line="45"/> + <source>minimal test</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/recurse_part/expectedoutput.txt new file mode 100644 index 0000000..808db18 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part/expectedoutput.txt @@ -0,0 +1 @@ +lupdate warning: no TS files specified\. Only diagnostics will be produced for 'project\.pro'\. diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/recurse_part/lupdatecmd new file mode 100644 index 0000000..3e15bc7 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part/lupdatecmd @@ -0,0 +1,2 @@ +TRANSLATION: project.ts project_sub.ts +cd ../../subdirs_part diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part/project.ts.before b/tests/auto/linguist/lupdate/testdata/good/recurse_part/project.ts.before new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part/project.ts.before diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_part/project.ts.result new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part/project.ts.result diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part/project_sub.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_part/project_sub.ts.result new file mode 100644 index 0000000..cddb963 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part/project_sub.ts.result @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0"> +<defaultcodec>ISO-8859-2</defaultcodec> +<context> + <name>subsub2</name> + <message> + <location filename="subdir2/subsub2/main.cpp" line="45"/> + <source>minimal test</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/expectedoutput.txt new file mode 100644 index 0000000..b904390 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/expectedoutput.txt @@ -0,0 +1 @@ +lupdate warning: TS files from command line prevent recursing into .*/subdir2/subsub2/subsub2\.pro\. diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/lupdatecmd new file mode 100644 index 0000000..41bfcec --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/lupdatecmd @@ -0,0 +1,3 @@ +TRANSLATION: project.ts project_sub.ts +cd ../../subdirs_part +lupdate project.pro -ts project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project.ts.result new file mode 100644 index 0000000..7d9a6f4 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project.ts.result @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0"> +<context> + <name>subdir1</name> + <message> + <location filename="subdir1/main.cpp" line="45"/> + <source>minimal test</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>subsub1</name> + <message> + <location filename="subdir2/subsub1/main.cpp" line="45"/> + <source>minimal test</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project_sub.ts.before b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project_sub.ts.before new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project_sub.ts.before diff --git a/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project_sub.ts.result b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project_sub.ts.result new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/recurse_part_ts/project_sub.ts.result diff --git a/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd index da6103f..90f609b 100644 --- a/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd +++ b/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd @@ -1,2 +1 @@ TRANSLATION: translations/project.ts -lupdate project.pro -ts translations/project.ts diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_full/project.pro b/tests/auto/linguist/lupdate/testdata/subdirs_full/project.pro new file mode 100644 index 0000000..1f744a7 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/subdirs_full/project.pro @@ -0,0 +1,4 @@ +TEMPLATE = subdirs +SUBDIRS = subdir1 subdir2/subdir2.pro + +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir1/main.cpp b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir1/main.cpp new file mode 100644 index 0000000..0f1dc70 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir1/main.cpp @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +QString foo() +{ + QCoreApplication::translate("subdir1","minimal test"); +} diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir1/subdir1.pro b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir1/subdir1.pro new file mode 100644 index 0000000..28dcadc --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir1/subdir1.pro @@ -0,0 +1 @@ +SOURCES += main.cpp diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subdir2.pro b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subdir2.pro new file mode 100644 index 0000000..f8d03df --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subdir2.pro @@ -0,0 +1,2 @@ +TEMPLATE = subdirs +SUBDIRS = subsub1 subsub2 diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub1/main.cpp b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub1/main.cpp new file mode 100644 index 0000000..8c82c80 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub1/main.cpp @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +QString foo() +{ + QCoreApplication::translate("subsub1","minimal test"); +} diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub1/subsub1.pro b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub1/subsub1.pro new file mode 100644 index 0000000..28dcadc --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub1/subsub1.pro @@ -0,0 +1 @@ +SOURCES += main.cpp diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub2/main.cpp b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub2/main.cpp new file mode 100644 index 0000000..ff85936 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub2/main.cpp @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +QString foo() +{ + QCoreApplication::translate("subsub2","minimal test"); +} diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub2/subsub2.pro b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub2/subsub2.pro new file mode 100644 index 0000000..3499222 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/subdirs_full/subdir2/subsub2/subsub2.pro @@ -0,0 +1,4 @@ +SOURCES += main.cpp + +TRANSLATIONS = ../../project_sub.ts +CODECFORTR = ISO-8859-2 diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_part/project.pro b/tests/auto/linguist/lupdate/testdata/subdirs_part/project.pro new file mode 100644 index 0000000..d803c37 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/subdirs_part/project.pro @@ -0,0 +1,2 @@ +TEMPLATE = subdirs +SUBDIRS = subdir1 subdir2/subdir2.pro diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir1/main.cpp b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir1/main.cpp new file mode 100644 index 0000000..0f1dc70 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir1/main.cpp @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +QString foo() +{ + QCoreApplication::translate("subdir1","minimal test"); +} diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir1/subdir1.pro b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir1/subdir1.pro new file mode 100644 index 0000000..28dcadc --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir1/subdir1.pro @@ -0,0 +1 @@ +SOURCES += main.cpp diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subdir2.pro b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subdir2.pro new file mode 100644 index 0000000..f8d03df --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subdir2.pro @@ -0,0 +1,2 @@ +TEMPLATE = subdirs +SUBDIRS = subsub1 subsub2 diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub1/main.cpp b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub1/main.cpp new file mode 100644 index 0000000..8c82c80 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub1/main.cpp @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +QString foo() +{ + QCoreApplication::translate("subsub1","minimal test"); +} diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub1/subsub1.pro b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub1/subsub1.pro new file mode 100644 index 0000000..28dcadc --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub1/subsub1.pro @@ -0,0 +1 @@ +SOURCES += main.cpp diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub2/main.cpp b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub2/main.cpp new file mode 100644 index 0000000..ff85936 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub2/main.cpp @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +QString foo() +{ + QCoreApplication::translate("subsub2","minimal test"); +} diff --git a/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub2/subsub2.pro b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub2/subsub2.pro new file mode 100644 index 0000000..3499222 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/subdirs_part/subdir2/subsub2/subsub2.pro @@ -0,0 +1,4 @@ +SOURCES += main.cpp + +TRANSLATIONS = ../../project_sub.ts +CODECFORTR = ISO-8859-2 diff --git a/tests/auto/linguist/lupdate/tst_lupdate.cpp b/tests/auto/linguist/lupdate/tst_lupdate.cpp index 568be37..c179462 100644 --- a/tests/auto/linguist/lupdate/tst_lupdate.cpp +++ b/tests/auto/linguist/lupdate/tst_lupdate.cpp @@ -59,8 +59,6 @@ public: private slots: void good_data(); void good(); - void commandline_data(); - void commandline(); #if CHECK_SIMTEXTH void simtexth(); void simtexth_data(); @@ -245,10 +243,10 @@ void tst_lupdate::good() qDebug() << "Checking..."; - QString generatedtsfile(dir + QLatin1String("/project.ts")); - - // look for a command + QString workDir = dir; + QStringList generatedtsfiles(QLatin1String("project.ts")); QString lupdatecmd; + QFile file(dir + "/lupdatecmd"); if (file.exists()) { QVERIFY2(file.open(QIODevice::ReadOnly | QIODevice::Text), qPrintable(file.fileName())); @@ -262,23 +260,32 @@ void tst_lupdate::good() break; } else if (cmdstring.startsWith("TRANSLATION:")) { cmdstring.remove(0, 12); - generatedtsfile = dir + QLatin1Char('/') + cmdstring.trimmed(); + generatedtsfiles.clear(); + foreach (const QByteArray &s, cmdstring.split(' ')) + if (!s.isEmpty()) + generatedtsfiles << s; + } else if (cmdstring.startsWith("cd ")) { + cmdstring.remove(0, 3); + workDir = QDir::cleanPath(dir + QLatin1Char('/') + cmdstring); } } file.close(); } - QFile::remove(generatedtsfile); - QString beforetsfile = generatedtsfile + QLatin1String(".before"); - if (QFile::exists(beforetsfile)) - QVERIFY2(QFile::copy(beforetsfile, generatedtsfile), qPrintable(beforetsfile)); + foreach (const QString &ts, generatedtsfiles) { + QString genTs = workDir + QLatin1Char('/') + ts; + QFile::remove(genTs); + QString beforetsfile = dir + QLatin1Char('/') + ts + QLatin1String(".before"); + if (QFile::exists(beforetsfile)) + QVERIFY2(QFile::copy(beforetsfile, genTs), qPrintable(beforetsfile)); + } if (lupdatecmd.isEmpty()) lupdatecmd = QLatin1String("project.pro"); lupdatecmd.prepend("-silent "); QProcess proc; - proc.setWorkingDirectory(dir); + proc.setWorkingDirectory(workDir); proc.setProcessChannelMode(QProcess::MergedChannels); proc.start(m_cmdLupdate + ' ' + lupdatecmd, QIODevice::ReadWrite | QIODevice::Text); QVERIFY2(proc.waitForFinished(5000), qPrintable(lupdatecmd)); @@ -287,7 +294,7 @@ void tst_lupdate::good() "\"lupdate " + lupdatecmd.toLatin1() + "\" crashed\n" + output); QVERIFY2(!proc.exitCode(), "\"lupdate " + lupdatecmd.toLatin1() + "\" exited with code " + - QByteArray::number(proc.exitCode()) + "\n" + proc.readAll()); + QByteArray::number(proc.exitCode()) + "\n" + output); // If the file expectedoutput.txt exists, compare the // console output with the content of that file @@ -299,47 +306,9 @@ void tst_lupdate::good() return; } - QString expectedFile = generatedtsfile + QLatin1String(".result"); - doCompare(generatedtsfile, expectedFile, false); -} - -void tst_lupdate::commandline_data() -{ - QTest::addColumn<QString>("currentPath"); - QTest::addColumn<QString>("commandline"); - QTest::addColumn<QString>("generatedtsfile"); - QTest::addColumn<QString>("expectedtsfile"); - - QTest::newRow("Recursive scan") << QString("recursivescan") - << QString(". -ts foo.ts") << QString("foo.ts") << QString("foo.ts.result"); - QTest::newRow("Deep path argument") << QString("recursivescan") - << QString("sub/finddialog.cpp -ts bar.ts") << QString("bar.ts") << QString("bar.ts.result"); -} - -void tst_lupdate::commandline() -{ - QFETCH(QString, currentPath); - QFETCH(QString, commandline); - QFETCH(QString, generatedtsfile); - QFETCH(QString, expectedtsfile); - - QString generated = - m_basePath + currentPath + QLatin1Char('/') + generatedtsfile; - QFile gen(generated); - if (gen.exists()) - QVERIFY(gen.remove()); - QProcess proc; - proc.setWorkingDirectory(m_basePath + currentPath); - proc.setProcessChannelMode(QProcess::MergedChannels); - proc.start(m_cmdLupdate + " -silent " + commandline, QIODevice::ReadWrite | QIODevice::Text); - QVERIFY2(proc.waitForFinished(5000), qPrintable(commandline)); - QVERIFY2(proc.exitStatus() == QProcess::NormalExit, - "\"lupdate -silent " + commandline.toLatin1() + "\" crashed\n" + proc.readAll()); - QVERIFY2(!proc.exitCode(), - "\"lupdate -silent " + commandline.toLatin1() + "\" exited with code " + - QByteArray::number(proc.exitCode()) + "\n" + proc.readAll()); - - doCompare(generated, m_basePath + currentPath + QLatin1Char('/') + expectedtsfile, false); + foreach (const QString &ts, generatedtsfiles) + doCompare(workDir + QLatin1Char('/') + ts, + dir + QLatin1Char('/') + ts + QLatin1String(".result"), false); } #if CHECK_SIMTEXTH diff --git a/tests/auto/qimagereader/baseline/35floppy.ico b/tests/auto/qimagereader/baseline/35floppy.ico Binary files differdeleted file mode 100644 index 59fd37e..0000000 --- a/tests/auto/qimagereader/baseline/35floppy.ico +++ /dev/null diff --git a/tests/auto/qimagereader/baseline/35floppy.png b/tests/auto/qimagereader/baseline/35floppy.png Binary files differnew file mode 100644 index 0000000..56b9b44 --- /dev/null +++ b/tests/auto/qimagereader/baseline/35floppy.png diff --git a/tests/auto/qimagereader/baseline/connect.png b/tests/auto/qimagereader/baseline/connect.png Binary files differnew file mode 100644 index 0000000..9544bb9 --- /dev/null +++ b/tests/auto/qimagereader/baseline/connect.png diff --git a/tests/auto/qimagereader/baseline/kde_favicon.ico b/tests/auto/qimagereader/baseline/kde_favicon.ico Binary files differdeleted file mode 100644 index 15bcdbb..0000000 --- a/tests/auto/qimagereader/baseline/kde_favicon.ico +++ /dev/null diff --git a/tests/auto/qimagereader/baseline/kde_favicon.png b/tests/auto/qimagereader/baseline/kde_favicon.png Binary files differnew file mode 100644 index 0000000..e19287b --- /dev/null +++ b/tests/auto/qimagereader/baseline/kde_favicon.png diff --git a/tests/auto/qimagereader/baseline/semitransparent.ico b/tests/auto/qimagereader/baseline/semitransparent.ico Binary files differdeleted file mode 100644 index dd23de9..0000000 --- a/tests/auto/qimagereader/baseline/semitransparent.ico +++ /dev/null diff --git a/tests/auto/qimagereader/baseline/semitransparent.png b/tests/auto/qimagereader/baseline/semitransparent.png Binary files differnew file mode 100644 index 0000000..a3ad780 --- /dev/null +++ b/tests/auto/qimagereader/baseline/semitransparent.png diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp index 72c5c8b..e7cfe68 100644 --- a/tests/auto/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/qimagereader/tst_qimagereader.cpp @@ -1633,7 +1633,8 @@ void tst_QImageReader::pixelCompareWithBaseline_data() QTest::newRow("floppy (16px,32px - 16 colors)") << "35floppy.ico"; QTest::newRow("semitransparent") << "semitransparent.ico"; - QTest::newRow("slightlybroken") << "kde_favicon.ico"; + QTest::newRow("slightlybrokenBMPHeader") << "kde_favicon.ico"; + QTest::newRow("sightlybrokenIconHeader") << "connect.ico"; } void tst_QImageReader::pixelCompareWithBaseline() @@ -1641,14 +1642,20 @@ void tst_QImageReader::pixelCompareWithBaseline() QFETCH(QString, fileName); QImage icoImg; + const QString inputFileName(QString::fromAscii("images/%1").arg(fileName)); + QFileInfo fi(inputFileName); + // might fail if the plugin does not exist, which is ok. - if (icoImg.load(QString::fromAscii("images/%1").arg(fileName))) { - QString baselineFileName = QString::fromAscii("baseline/%1").arg(fileName); + if (icoImg.load(inputFileName)) { + icoImg = icoImg.convertToFormat(QImage::Format_ARGB32_Premultiplied); + const QString baselineFileName(QString::fromAscii("baseline/%1.png").arg(fi.baseName())); #if 0 icoImg.save(baselineFileName); #else QImage baseImg; QVERIFY(baseImg.load(baselineFileName)); + baseImg = baseImg.convertToFormat(QImage::Format_ARGB32_Premultiplied); + QCOMPARE(int(baseImg.format()), int(icoImg.format())); QCOMPARE(baseImg, icoImg); #endif } diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp index b384a55..ef960d0 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp +++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp @@ -2907,7 +2907,7 @@ void tst_QScriptValue::equals() QScriptValue qobj1 = eng.newQObject(this); QScriptValue qobj2 = eng.newQObject(this); QScriptValue qobj3 = eng.newQObject(0); - QScriptValue qobj4 = eng.newQObject(new QObject()); + QScriptValue qobj4 = eng.newQObject(new QObject(), QScriptEngine::ScriptOwnership); QVERIFY(qobj1.equals(qobj2)); // compares the QObject pointers QVERIFY(!qobj2.equals(qobj4)); // compares the QObject pointers QVERIFY(!qobj2.equals(obj2)); // compares the QObject pointers @@ -3091,6 +3091,20 @@ void tst_QScriptValue::strictlyEquals() QVERIFY(!falskt.strictlyEquals(null)); QVERIFY(!falskt.strictlyEquals(QScriptValue())); + QVERIFY(!QScriptValue(false).strictlyEquals(123)); + QVERIFY(!QScriptValue(QScriptValue::UndefinedValue).strictlyEquals(123)); + QVERIFY(!QScriptValue(QScriptValue::NullValue).strictlyEquals(123)); + QVERIFY(!QScriptValue(false).strictlyEquals("ciao")); + QVERIFY(!QScriptValue(QScriptValue::UndefinedValue).strictlyEquals("ciao")); + QVERIFY(!QScriptValue(QScriptValue::NullValue).strictlyEquals("ciao")); + QVERIFY(QScriptValue(&eng, "ciao").strictlyEquals("ciao")); + QVERIFY(QScriptValue("ciao").strictlyEquals(QScriptValue(&eng, "ciao"))); + QVERIFY(!QScriptValue("ciao").strictlyEquals(123)); + QVERIFY(!QScriptValue("ciao").strictlyEquals(QScriptValue(&eng, 123))); + QVERIFY(!QScriptValue(123).strictlyEquals("ciao")); + QVERIFY(!QScriptValue(123).strictlyEquals(QScriptValue(&eng, "ciao"))); + QVERIFY(!QScriptValue(&eng, 123).strictlyEquals("ciao")); + QScriptValue obj1 = eng.newObject(); QScriptValue obj2 = eng.newObject(); QCOMPARE(obj1.strictlyEquals(obj2), false); diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp index 33812fe..f108f4c 100644 --- a/tests/auto/qurl/tst_qurl.cpp +++ b/tests/auto/qurl/tst_qurl.cpp @@ -165,6 +165,8 @@ private slots: void ace_testsuite(); void std3violations_data(); void std3violations(); + void std3deviations_data(); + void std3deviations(); void tldRestrictions_data(); void tldRestrictions(); void emptyQueryOrFragment(); @@ -3238,6 +3240,8 @@ void tst_QUrl::std3violations_data() QTest::newRow("bang") << "foo!" << false; QTest::newRow("plus") << "foo+bar" << false; QTest::newRow("dot") << "foo.bar"; + QTest::newRow("startingdot") << ".bar" << false; + QTest::newRow("startingdot2") << ".example.com" << false; QTest::newRow("slash") << "foo/bar" << true; QTest::newRow("colon") << "foo:80" << true; QTest::newRow("question") << "foo?bar" << true; @@ -3282,6 +3286,24 @@ void tst_QUrl::std3violations() QVERIFY(!url.isValid()); } +void tst_QUrl::std3deviations_data() +{ + QTest::addColumn<QString>("source"); + + QTest::newRow("ending-dot") << "example.com."; + QTest::newRow("ending-dot3002") << QString("example.com") + QChar(0x3002); +} + +void tst_QUrl::std3deviations() +{ + QFETCH(QString, source); + QVERIFY(!QUrl::toAce(source).isEmpty()); + + QUrl url; + url.setHost(source); + QVERIFY(!url.host().isEmpty()); +} + void tst_QUrl::tldRestrictions_data() { QTest::addColumn<QString>("tld"); diff --git a/tests/auto/selftests/expected_xunit.txt b/tests/auto/selftests/expected_xunit.txt index 5ec4668..3c014e3 100644 --- a/tests/auto/selftests/expected_xunit.txt +++ b/tests/auto/selftests/expected_xunit.txt @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8" ?> <testsuite errors="5" failures="3" tests="9" name="tst_Xunit"> <properties> - <property value="4.6.2" name="QTestVersion"/> - <property value="4.6.2" name="QtVersion"/> + <property value="<INSERT_QT_VERSION_HERE>" name="QTestVersion"/> + <property value="<INSERT_QT_VERSION_HERE>" name="QtVersion"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="testFunc1"> diff --git a/tests/auto/selftests/tst_selftests.cpp b/tests/auto/selftests/tst_selftests.cpp index 89ece0f..0b9cee0 100644 --- a/tests/auto/selftests/tst_selftests.cpp +++ b/tests/auto/selftests/tst_selftests.cpp @@ -248,7 +248,7 @@ void tst_Selftests::doRunSubTest(QString &subdir, QStringList &arguments ) continue; const QString output(QString::fromLatin1(line)); - const QString expected(QString::fromLatin1(exp.at(i))); + const QString expected(QString::fromLatin1(exp.at(i)).replace("<INSERT_QT_VERSION_HERE>", QT_VERSION_STR)); if (line.contains("ASSERT") && output != expected) QEXPECT_FAIL("assert", "QTestLib prints out the absolute path.", Continue); diff --git a/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro b/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro index 39267c8..3f49ccc 100644 --- a/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro +++ b/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro @@ -1,7 +1,6 @@ TEMPLATE = subdirs contains(QT_CONFIG,xmlpatterns) { SUBDIRS += lib - !wince*:lib.file = lib/lib.pro test.depends = lib } SUBDIRS += test |