From 19988e1a2b81ae4a54edb6fec1f489326ae39089 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 18 Mar 2010 11:10:05 +1000 Subject: Fix tests after 47fb07c9fdf47584ae55f3412102bbeef5576b04. The import order has changed, so test files that mirror element names needed to be renamed (or they would resolve as the type). --- .../qdeclarativegridview/data/gridview.qml | 56 ---------- .../qdeclarativegridview/data/gridview1.qml | 56 ++++++++++ .../qdeclarativegridview/data/propertychanges.qml | 69 ------------ .../data/propertychangestest.qml | 69 ++++++++++++ .../tst_qdeclarativegridview.cpp | 20 ++-- .../qdeclarativeitem/data/keynavigation.qml | 47 -------- .../qdeclarativeitem/data/keynavigationtest.qml | 47 ++++++++ .../declarative/qdeclarativeitem/data/keys.qml | 20 ---- .../declarative/qdeclarativeitem/data/keystest.qml | 20 ++++ .../qdeclarativeitem/tst_qdeclarativeitem.cpp | 4 +- .../qdeclarativelistview/data/listview.qml | 119 --------------------- .../qdeclarativelistview/data/listviewtest.qml | 119 +++++++++++++++++++++ .../qdeclarativelistview/data/propertychanges.qml | 71 ------------ .../data/propertychangestest.qml | 71 ++++++++++++ .../tst_qdeclarativelistview.cpp | 24 ++--- .../qdeclarativeparticles/data/particlemotion.qml | 35 ------ .../data/particlemotiontest.qml | 35 ++++++ .../qdeclarativeparticles/data/particles.qml | 17 --- .../qdeclarativeparticles/data/particlestest.qml | 17 +++ .../tst_qdeclarativeparticles.cpp | 8 +- .../declarative/qdeclarativepathview/data/path.qml | 14 --- .../qdeclarativepathview/data/pathtest.qml | 14 +++ .../qdeclarativepathview/data/pathview.qml | 75 ------------- .../qdeclarativepathview/data/pathview0.qml | 75 +++++++++++++ .../tst_qdeclarativepathview.cpp | 8 +- .../qdeclarativepositioners/data/grid.qml | 39 ------- .../qdeclarativepositioners/data/gridtest.qml | 39 +++++++ .../data/propertychanges.qml | 39 ------- .../data/propertychangestest.qml | 39 +++++++ .../qdeclarativepositioners/data/repeater.qml | 20 ---- .../qdeclarativepositioners/data/repeatertest.qml | 20 ++++ .../tst_qdeclarativepositioners.cpp | 7 +- .../qdeclarativerepeater/data/repeater.qml | 28 ----- .../qdeclarativerepeater/data/repeater1.qml | 28 +++++ .../tst_qdeclarativerepeater.cpp | 2 +- .../qdeclarativestates/data/anchorChanges.qml | 23 ---- .../qdeclarativestates/data/anchorChanges1.qml | 23 ++++ .../qdeclarativestates/data/parentChange.qml | 37 ------- .../qdeclarativestates/data/parentChange1.qml | 37 +++++++ .../qdeclarativestates/tst_qdeclarativestates.cpp | 4 +- 40 files changed, 748 insertions(+), 747 deletions(-) delete mode 100644 tests/auto/declarative/qdeclarativegridview/data/gridview.qml create mode 100644 tests/auto/declarative/qdeclarativegridview/data/gridview1.qml delete mode 100644 tests/auto/declarative/qdeclarativegridview/data/propertychanges.qml create mode 100644 tests/auto/declarative/qdeclarativegridview/data/propertychangestest.qml delete mode 100644 tests/auto/declarative/qdeclarativeitem/data/keynavigation.qml create mode 100644 tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml delete mode 100644 tests/auto/declarative/qdeclarativeitem/data/keys.qml create mode 100644 tests/auto/declarative/qdeclarativeitem/data/keystest.qml delete mode 100644 tests/auto/declarative/qdeclarativelistview/data/listview.qml create mode 100644 tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml delete mode 100644 tests/auto/declarative/qdeclarativelistview/data/propertychanges.qml create mode 100644 tests/auto/declarative/qdeclarativelistview/data/propertychangestest.qml delete mode 100644 tests/auto/declarative/qdeclarativeparticles/data/particlemotion.qml create mode 100644 tests/auto/declarative/qdeclarativeparticles/data/particlemotiontest.qml delete mode 100644 tests/auto/declarative/qdeclarativeparticles/data/particles.qml create mode 100644 tests/auto/declarative/qdeclarativeparticles/data/particlestest.qml delete mode 100644 tests/auto/declarative/qdeclarativepathview/data/path.qml create mode 100644 tests/auto/declarative/qdeclarativepathview/data/pathtest.qml delete mode 100644 tests/auto/declarative/qdeclarativepathview/data/pathview.qml create mode 100644 tests/auto/declarative/qdeclarativepathview/data/pathview0.qml delete mode 100644 tests/auto/declarative/qdeclarativepositioners/data/grid.qml create mode 100644 tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml delete mode 100644 tests/auto/declarative/qdeclarativepositioners/data/propertychanges.qml create mode 100644 tests/auto/declarative/qdeclarativepositioners/data/propertychangestest.qml delete mode 100644 tests/auto/declarative/qdeclarativepositioners/data/repeater.qml create mode 100644 tests/auto/declarative/qdeclarativepositioners/data/repeatertest.qml delete mode 100644 tests/auto/declarative/qdeclarativerepeater/data/repeater.qml create mode 100644 tests/auto/declarative/qdeclarativerepeater/data/repeater1.qml delete mode 100644 tests/auto/declarative/qdeclarativestates/data/anchorChanges.qml create mode 100644 tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml delete mode 100644 tests/auto/declarative/qdeclarativestates/data/parentChange.qml create mode 100644 tests/auto/declarative/qdeclarativestates/data/parentChange1.qml diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview.qml deleted file mode 100644 index ba6b807..0000000 --- a/tests/auto/declarative/qdeclarativegridview/data/gridview.qml +++ /dev/null @@ -1,56 +0,0 @@ -import Qt 4.6 - -Rectangle { - id: root - property int added: -1 - property var removed - - width: 240 - height: 320 - color: "#ffffff" - resources: [ - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - width: 80 - height: 60 - border.color: "blue" - Text { - text: index - } - Text { - x: 40 - text: wrapper.x + ", " + wrapper.y - } - Text { - y: 20 - id: textName - objectName: "textName" - text: name - } - Text { - y: 40 - id: textNumber - objectName: "textNumber" - text: number - } - color: GridView.isCurrentItem ? "lightsteelblue" : "white" - GridView.onAdd: root.added = index - GridView.onRemove: root.removed = name - } - } - ] - GridView { - id: grid - objectName: "grid" - width: 240 - height: 320 - cellWidth: 80 - cellHeight: 60 - flow: (testTopToBottom == false) ? "LeftToRight" : "TopToBottom" - model: testModel - delegate: myDelegate - } -} diff --git a/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml b/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml new file mode 100644 index 0000000..ba6b807 --- /dev/null +++ b/tests/auto/declarative/qdeclarativegridview/data/gridview1.qml @@ -0,0 +1,56 @@ +import Qt 4.6 + +Rectangle { + id: root + property int added: -1 + property var removed + + width: 240 + height: 320 + color: "#ffffff" + resources: [ + Component { + id: myDelegate + Rectangle { + id: wrapper + objectName: "wrapper" + width: 80 + height: 60 + border.color: "blue" + Text { + text: index + } + Text { + x: 40 + text: wrapper.x + ", " + wrapper.y + } + Text { + y: 20 + id: textName + objectName: "textName" + text: name + } + Text { + y: 40 + id: textNumber + objectName: "textNumber" + text: number + } + color: GridView.isCurrentItem ? "lightsteelblue" : "white" + GridView.onAdd: root.added = index + GridView.onRemove: root.removed = name + } + } + ] + GridView { + id: grid + objectName: "grid" + width: 240 + height: 320 + cellWidth: 80 + cellHeight: 60 + flow: (testTopToBottom == false) ? "LeftToRight" : "TopToBottom" + model: testModel + delegate: myDelegate + } +} diff --git a/tests/auto/declarative/qdeclarativegridview/data/propertychanges.qml b/tests/auto/declarative/qdeclarativegridview/data/propertychanges.qml deleted file mode 100644 index da2e8d0..0000000 --- a/tests/auto/declarative/qdeclarativegridview/data/propertychanges.qml +++ /dev/null @@ -1,69 +0,0 @@ -import Qt 4.6 - -Rectangle { - width: 360; height: 120; color: "white" - Component { - id: delegate - Item { - id: wrapper - width: 180; height: 40; - Column { - x: 5; y: 5 - Text { text: 'Name: ' + name } - Text { text: 'Number: ' + number } - } - } - } - Component { - id: highlightRed - Rectangle { - color: "red" - radius: 10 - opacity: 0.5 - } - } - GridView { - cellWidth:180 - cellHeight:40 - objectName: "gridView" - anchors.fill: parent - model: listModel - delegate: delegate - highlight: highlightRed - focus: true - keyNavigationWraps: true - cacheBuffer: 10 - flow: GridView.LeftToRight - } - - data:[ - ListModel { - id: listModel - ListElement { - name: "Bill Smith" - number: "555 3264" - } - ListElement { - name: "John Brown" - number: "555 8426" - } - ListElement { - name: "Sam Wise" - number: "555 0473" - } - }, - ListModel { - objectName: "alternateModel" - ListElement { - name: "Jack" - number: "555 8426" - } - ListElement { - name: "Mary" - number: "555 3264" - } - } - ] -} - - \ No newline at end of file diff --git a/tests/auto/declarative/qdeclarativegridview/data/propertychangestest.qml b/tests/auto/declarative/qdeclarativegridview/data/propertychangestest.qml new file mode 100644 index 0000000..da2e8d0 --- /dev/null +++ b/tests/auto/declarative/qdeclarativegridview/data/propertychangestest.qml @@ -0,0 +1,69 @@ +import Qt 4.6 + +Rectangle { + width: 360; height: 120; color: "white" + Component { + id: delegate + Item { + id: wrapper + width: 180; height: 40; + Column { + x: 5; y: 5 + Text { text: 'Name: ' + name } + Text { text: 'Number: ' + number } + } + } + } + Component { + id: highlightRed + Rectangle { + color: "red" + radius: 10 + opacity: 0.5 + } + } + GridView { + cellWidth:180 + cellHeight:40 + objectName: "gridView" + anchors.fill: parent + model: listModel + delegate: delegate + highlight: highlightRed + focus: true + keyNavigationWraps: true + cacheBuffer: 10 + flow: GridView.LeftToRight + } + + data:[ + ListModel { + id: listModel + ListElement { + name: "Bill Smith" + number: "555 3264" + } + ListElement { + name: "John Brown" + number: "555 8426" + } + ListElement { + name: "Sam Wise" + number: "555 0473" + } + }, + ListModel { + objectName: "alternateModel" + ListElement { + name: "Jack" + number: "555 8426" + } + ListElement { + name: "Mary" + number: "555 3264" + } + } + ] +} + + \ No newline at end of file diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp index 385d6f5..dd594774 100644 --- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp +++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp @@ -165,7 +165,7 @@ void tst_QDeclarativeGridView::items() ctxt->setContextProperty("testModel", &model); ctxt->setContextProperty("testTopToBottom", QVariant(false)); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml")); qApp->processEvents(); QDeclarativeGridView *gridview = findItem(canvas->rootObject(), "grid"); @@ -213,7 +213,7 @@ void tst_QDeclarativeGridView::changed() ctxt->setContextProperty("testModel", &model); ctxt->setContextProperty("testTopToBottom", QVariant(false)); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml")); qApp->processEvents(); QDeclarativeFlickable *gridview = findItem(canvas->rootObject(), "grid"); @@ -246,7 +246,7 @@ void tst_QDeclarativeGridView::inserted() ctxt->setContextProperty("testModel", &model); ctxt->setContextProperty("testTopToBottom", QVariant(false)); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml")); qApp->processEvents(); QDeclarativeGridView *gridview = findItem(canvas->rootObject(), "grid"); @@ -331,7 +331,7 @@ void tst_QDeclarativeGridView::removed() ctxt->setContextProperty("testModel", &model); ctxt->setContextProperty("testTopToBottom", QVariant(false)); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml")); qApp->processEvents(); QDeclarativeGridView *gridview = findItem(canvas->rootObject(), "grid"); @@ -495,7 +495,7 @@ void tst_QDeclarativeGridView::moved() ctxt->setContextProperty("testModel", &model); ctxt->setContextProperty("testTopToBottom", QVariant(false)); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml")); qApp->processEvents(); QDeclarativeGridView *gridview = findItem(canvas->rootObject(), "grid"); @@ -723,7 +723,7 @@ void tst_QDeclarativeGridView::changeFlow() ctxt->setContextProperty("testModel", &model); ctxt->setContextProperty("testTopToBottom", QVariant(false)); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml")); qApp->processEvents(); QDeclarativeGridView *gridview = findItem(canvas->rootObject(), "grid"); @@ -820,7 +820,7 @@ void tst_QDeclarativeGridView::propertyChanges() { QDeclarativeView *canvas = createView(); QVERIFY(canvas); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml")); QDeclarativeGridView *gridView = canvas->rootObject()->findChild("gridView"); QVERIFY(gridView); @@ -860,7 +860,7 @@ void tst_QDeclarativeGridView::componentChanges() { QDeclarativeView *canvas = createView(); QVERIFY(canvas); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml")); QDeclarativeGridView *gridView = canvas->rootObject()->findChild("gridView"); QVERIFY(gridView); @@ -895,7 +895,7 @@ void tst_QDeclarativeGridView::modelChanges() { QDeclarativeView *canvas = createView(); QVERIFY(canvas); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml")); QDeclarativeGridView *gridView = canvas->rootObject()->findChild("gridView"); QVERIFY(gridView); @@ -929,7 +929,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex() ctxt->setContextProperty("testModel", &model); ctxt->setContextProperty("testTopToBottom", QVariant(false)); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml")); qApp->processEvents(); QDeclarativeGridView *gridview = findItem(canvas->rootObject(), "grid"); diff --git a/tests/auto/declarative/qdeclarativeitem/data/keynavigation.qml b/tests/auto/declarative/qdeclarativeitem/data/keynavigation.qml deleted file mode 100644 index 08da901..0000000 --- a/tests/auto/declarative/qdeclarativeitem/data/keynavigation.qml +++ /dev/null @@ -1,47 +0,0 @@ -import Qt 4.6 - -Grid { - columns: 2 - width: 100; height: 100 - Rectangle { - id: item1 - objectName: "item1" - focus: true - width: 50; height: 50 - color: focus ? "red" : "lightgray" - KeyNavigation.right: item2 - KeyNavigation.down: item3 - KeyNavigation.tab: item2 - KeyNavigation.backtab: item4 - } - Rectangle { - id: item2 - objectName: "item2" - width: 50; height: 50 - color: focus ? "red" : "lightgray" - KeyNavigation.left: item1 - KeyNavigation.down: item4 - KeyNavigation.tab: item3 - KeyNavigation.backtab: item1 - } - Rectangle { - id: item3 - objectName: "item3" - width: 50; height: 50 - color: focus ? "red" : "lightgray" - KeyNavigation.right: item4 - KeyNavigation.up: item1 - KeyNavigation.tab: item4 - KeyNavigation.backtab: item2 - } - Rectangle { - id: item4 - objectName: "item4" - width: 50; height: 50 - color: focus ? "red" : "lightgray" - KeyNavigation.left: item3 - KeyNavigation.up: item2 - KeyNavigation.tab: item1 - KeyNavigation.backtab: item3 - } -} diff --git a/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml b/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml new file mode 100644 index 0000000..08da901 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml @@ -0,0 +1,47 @@ +import Qt 4.6 + +Grid { + columns: 2 + width: 100; height: 100 + Rectangle { + id: item1 + objectName: "item1" + focus: true + width: 50; height: 50 + color: focus ? "red" : "lightgray" + KeyNavigation.right: item2 + KeyNavigation.down: item3 + KeyNavigation.tab: item2 + KeyNavigation.backtab: item4 + } + Rectangle { + id: item2 + objectName: "item2" + width: 50; height: 50 + color: focus ? "red" : "lightgray" + KeyNavigation.left: item1 + KeyNavigation.down: item4 + KeyNavigation.tab: item3 + KeyNavigation.backtab: item1 + } + Rectangle { + id: item3 + objectName: "item3" + width: 50; height: 50 + color: focus ? "red" : "lightgray" + KeyNavigation.right: item4 + KeyNavigation.up: item1 + KeyNavigation.tab: item4 + KeyNavigation.backtab: item2 + } + Rectangle { + id: item4 + objectName: "item4" + width: 50; height: 50 + color: focus ? "red" : "lightgray" + KeyNavigation.left: item3 + KeyNavigation.up: item2 + KeyNavigation.tab: item1 + KeyNavigation.backtab: item3 + } +} diff --git a/tests/auto/declarative/qdeclarativeitem/data/keys.qml b/tests/auto/declarative/qdeclarativeitem/data/keys.qml deleted file mode 100644 index 7d34fc8..0000000 --- a/tests/auto/declarative/qdeclarativeitem/data/keys.qml +++ /dev/null @@ -1,20 +0,0 @@ -import Qt 4.6 - -Item { - focus: true - Keys.onPressed: keysTestObject.keyPress(event.key, event.text, event.modifiers) - Keys.onReleased: { keysTestObject.keyRelease(event.key, event.text, event.modifiers); event.accepted = true; } - Keys.onReturnPressed: keysTestObject.keyPress(event.key, "Return", event.modifiers) - Keys.onDigit0Pressed: keysTestObject.keyPress(event.key, event.text, event.modifiers) - Keys.onDigit9Pressed: { event.accepted = false; keysTestObject.keyPress(event.key, event.text, event.modifiers) } - Keys.onTabPressed: keysTestObject.keyPress(event.key, "Tab", event.modifiers) - Keys.onBacktabPressed: keysTestObject.keyPress(event.key, "Backtab", event.modifiers) - Keys.forwardTo: [ item2 ] - Keys.enabled: enableKeyHanding - - Item { - id: item2 - Keys.onPressed: keysTestObject.forwardedKey(event.key) - Keys.onReleased: keysTestObject.forwardedKey(event.key) - } -} diff --git a/tests/auto/declarative/qdeclarativeitem/data/keystest.qml b/tests/auto/declarative/qdeclarativeitem/data/keystest.qml new file mode 100644 index 0000000..7d34fc8 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeitem/data/keystest.qml @@ -0,0 +1,20 @@ +import Qt 4.6 + +Item { + focus: true + Keys.onPressed: keysTestObject.keyPress(event.key, event.text, event.modifiers) + Keys.onReleased: { keysTestObject.keyRelease(event.key, event.text, event.modifiers); event.accepted = true; } + Keys.onReturnPressed: keysTestObject.keyPress(event.key, "Return", event.modifiers) + Keys.onDigit0Pressed: keysTestObject.keyPress(event.key, event.text, event.modifiers) + Keys.onDigit9Pressed: { event.accepted = false; keysTestObject.keyPress(event.key, event.text, event.modifiers) } + Keys.onTabPressed: keysTestObject.keyPress(event.key, "Tab", event.modifiers) + Keys.onBacktabPressed: keysTestObject.keyPress(event.key, "Backtab", event.modifiers) + Keys.forwardTo: [ item2 ] + Keys.enabled: enableKeyHanding + + Item { + id: item2 + Keys.onPressed: keysTestObject.forwardedKey(event.key) + Keys.onReleased: keysTestObject.forwardedKey(event.key) + } +} diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp index 45d670f..ba69cd8 100644 --- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp +++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp @@ -120,7 +120,7 @@ void tst_QDeclarativeItem::keys() canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(true)); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/keys.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/keystest.qml")); canvas->show(); qApp->processEvents(); @@ -215,7 +215,7 @@ void tst_QDeclarativeItem::keyNavigation() QDeclarativeView *canvas = new QDeclarativeView(0); canvas->setFixedSize(240,320); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/keynavigation.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/keynavigationtest.qml")); canvas->show(); qApp->processEvents(); diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview.qml b/tests/auto/declarative/qdeclarativelistview/data/listview.qml deleted file mode 100644 index 1c1b3f8..0000000 --- a/tests/auto/declarative/qdeclarativelistview/data/listview.qml +++ /dev/null @@ -1,119 +0,0 @@ -import Qt 4.6 - -Rectangle { - width: 240 - height: 320 - color: "#ffffff" - function checkProperties() { - testObject.error = false; - if (list.model != testModel) { - console.log("model property incorrect"); - testObject.error = true; - } - if (!testObject.animate && list.delegate != myDelegate) { - console.log("delegate property incorrect - expected myDelegate"); - testObject.error = true; - } - if (testObject.animate && list.delegate != animatedDelegate) { - console.log("delegate property incorrect - expected animatedDelegate"); - testObject.error = true; - } - if (testObject.invalidHighlight && list.highlight != invalidHl) { - console.log("highlight property incorrect - expected invalidHl"); - testObject.error = true; - } - if (!testObject.invalidHighlight && list.highlight != myHighlight) { - console.log("highlight property incorrect - expected myHighlight"); - testObject.error = true; - } - } - resources: [ - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - } - }, - Component { - id: animatedDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - ListView.onRemove: SequentialAnimation { - ScriptAction { script: console.log("Fix PropertyAction with attached properties") } -/* - PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true } - NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: "InOutQuad" } - PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false } -*/ - } - } - }, - Component { - id: myHighlight - Rectangle { color: "green" } - }, - Component { - id: invalidHl - EaseFollow {} - } - ] - ListView { - id: list - objectName: "list" - focus: true - width: 240 - height: 320 - model: testModel - delegate: testObject.animate ? animatedDelegate : myDelegate - highlight: testObject.invalidHighlight ? invalidHl : myHighlight - highlightMoveSpeed: 1000 - highlightResizeSpeed: 1000 - cacheBuffer: testObject.cacheBuffer - } -} diff --git a/tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml b/tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml new file mode 100644 index 0000000..1c1b3f8 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelistview/data/listviewtest.qml @@ -0,0 +1,119 @@ +import Qt 4.6 + +Rectangle { + width: 240 + height: 320 + color: "#ffffff" + function checkProperties() { + testObject.error = false; + if (list.model != testModel) { + console.log("model property incorrect"); + testObject.error = true; + } + if (!testObject.animate && list.delegate != myDelegate) { + console.log("delegate property incorrect - expected myDelegate"); + testObject.error = true; + } + if (testObject.animate && list.delegate != animatedDelegate) { + console.log("delegate property incorrect - expected animatedDelegate"); + testObject.error = true; + } + if (testObject.invalidHighlight && list.highlight != invalidHl) { + console.log("highlight property incorrect - expected invalidHl"); + testObject.error = true; + } + if (!testObject.invalidHighlight && list.highlight != myHighlight) { + console.log("highlight property incorrect - expected myHighlight"); + testObject.error = true; + } + } + resources: [ + Component { + id: myDelegate + Rectangle { + id: wrapper + objectName: "wrapper" + height: 20 + width: 240 + Text { + text: index + } + Text { + x: 30 + id: textName + objectName: "textName" + text: name + } + Text { + x: 120 + id: textNumber + objectName: "textNumber" + text: number + } + Text { + x: 200 + text: wrapper.y + } + color: ListView.isCurrentItem ? "lightsteelblue" : "white" + } + }, + Component { + id: animatedDelegate + Rectangle { + id: wrapper + objectName: "wrapper" + height: 20 + width: 240 + Text { + text: index + } + Text { + x: 30 + id: textName + objectName: "textName" + text: name + } + Text { + x: 120 + id: textNumber + objectName: "textNumber" + text: number + } + Text { + x: 200 + text: wrapper.y + } + color: ListView.isCurrentItem ? "lightsteelblue" : "white" + ListView.onRemove: SequentialAnimation { + ScriptAction { script: console.log("Fix PropertyAction with attached properties") } +/* + PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true } + NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: "InOutQuad" } + PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false } +*/ + } + } + }, + Component { + id: myHighlight + Rectangle { color: "green" } + }, + Component { + id: invalidHl + EaseFollow {} + } + ] + ListView { + id: list + objectName: "list" + focus: true + width: 240 + height: 320 + model: testModel + delegate: testObject.animate ? animatedDelegate : myDelegate + highlight: testObject.invalidHighlight ? invalidHl : myHighlight + highlightMoveSpeed: 1000 + highlightResizeSpeed: 1000 + cacheBuffer: testObject.cacheBuffer + } +} diff --git a/tests/auto/declarative/qdeclarativelistview/data/propertychanges.qml b/tests/auto/declarative/qdeclarativelistview/data/propertychanges.qml deleted file mode 100644 index a41f003..0000000 --- a/tests/auto/declarative/qdeclarativelistview/data/propertychanges.qml +++ /dev/null @@ -1,71 +0,0 @@ -import Qt 4.6 - -Rectangle { - width: 180; height: 120; color: "white" - Component { - id: delegate - Item { - id: wrapper - width: 180; height: 40; - Column { - x: 5; y: 5 - Text { text: 'Name: ' + name } - Text { text: 'Number: ' + number } - } - } - } - Component { - id: highlightRed - Rectangle { - color: "red" - radius: 10 - opacity: 0.5 - } - } - ListView { - objectName: "listView" - anchors.fill: parent - model: listModel - delegate: delegate - highlight: highlightRed - focus: true - highlightFollowsCurrentItem: true - preferredHighlightBegin: 0.0 - preferredHighlightEnd: 0.0 - highlightRangeMode: ListView.ApplyRange - keyNavigationWraps: true - cacheBuffer: 10 - snapMode: ListView.SnapToItem - } - - data:[ - ListModel { - id: listModel - ListElement { - name: "Bill Smith" - number: "555 3264" - } - ListElement { - name: "John Brown" - number: "555 8426" - } - ListElement { - name: "Sam Wise" - number: "555 0473" - } - }, - ListModel { - objectName: "alternateModel" - ListElement { - name: "Jack" - number: "555 8426" - } - ListElement { - name: "Mary" - number: "555 3264" - } - } - ] -} - - \ No newline at end of file diff --git a/tests/auto/declarative/qdeclarativelistview/data/propertychangestest.qml b/tests/auto/declarative/qdeclarativelistview/data/propertychangestest.qml new file mode 100644 index 0000000..a41f003 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelistview/data/propertychangestest.qml @@ -0,0 +1,71 @@ +import Qt 4.6 + +Rectangle { + width: 180; height: 120; color: "white" + Component { + id: delegate + Item { + id: wrapper + width: 180; height: 40; + Column { + x: 5; y: 5 + Text { text: 'Name: ' + name } + Text { text: 'Number: ' + number } + } + } + } + Component { + id: highlightRed + Rectangle { + color: "red" + radius: 10 + opacity: 0.5 + } + } + ListView { + objectName: "listView" + anchors.fill: parent + model: listModel + delegate: delegate + highlight: highlightRed + focus: true + highlightFollowsCurrentItem: true + preferredHighlightBegin: 0.0 + preferredHighlightEnd: 0.0 + highlightRangeMode: ListView.ApplyRange + keyNavigationWraps: true + cacheBuffer: 10 + snapMode: ListView.SnapToItem + } + + data:[ + ListModel { + id: listModel + ListElement { + name: "Bill Smith" + number: "555 3264" + } + ListElement { + name: "John Brown" + number: "555 8426" + } + ListElement { + name: "Sam Wise" + number: "555 0473" + } + }, + ListModel { + objectName: "alternateModel" + ListElement { + name: "Jack" + number: "555 8426" + } + ListElement { + name: "Mary" + number: "555 3264" + } + } + ] +} + + \ No newline at end of file diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index 5b57487..8d94804 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -321,7 +321,7 @@ void tst_QDeclarativeListView::items() TestObject *testObject = new TestObject; ctxt->setContextProperty("testObject", testObject); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml")); qApp->processEvents(); QDeclarativeListView *listview = findItem(canvas->rootObject(), "list"); @@ -402,7 +402,7 @@ void tst_QDeclarativeListView::changed() TestObject *testObject = new TestObject; ctxt->setContextProperty("testObject", testObject); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml")); qApp->processEvents(); QDeclarativeFlickable *listview = findItem(canvas->rootObject(), "list"); @@ -438,7 +438,7 @@ void tst_QDeclarativeListView::inserted() TestObject *testObject = new TestObject; ctxt->setContextProperty("testObject", testObject); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml")); qApp->processEvents(); QDeclarativeListView *listview = findItem(canvas->rootObject(), "list"); @@ -531,7 +531,7 @@ void tst_QDeclarativeListView::removed(bool animated) testObject->setAnimate(animated); ctxt->setContextProperty("testObject", testObject); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml")); qApp->processEvents(); QDeclarativeListView *listview = findItem(canvas->rootObject(), "list"); @@ -673,7 +673,7 @@ void tst_QDeclarativeListView::clear() TestObject *testObject = new TestObject; ctxt->setContextProperty("testObject", testObject); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml")); qApp->processEvents(); QDeclarativeListView *listview = findItem(canvas->rootObject(), "list"); @@ -710,7 +710,7 @@ void tst_QDeclarativeListView::moved() TestObject *testObject = new TestObject; ctxt->setContextProperty("testObject", testObject); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml")); qApp->processEvents(); QDeclarativeListView *listview = findItem(canvas->rootObject(), "list"); @@ -851,7 +851,7 @@ void tst_QDeclarativeListView::spacing() TestObject *testObject = new TestObject; ctxt->setContextProperty("testObject", testObject); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml")); qApp->processEvents(); QDeclarativeListView *listview = findItem(canvas->rootObject(), "list"); @@ -1122,7 +1122,7 @@ void tst_QDeclarativeListView::cacheBuffer() TestObject *testObject = new TestObject; ctxt->setContextProperty("testObject", testObject); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml")); qApp->processEvents(); QDeclarativeListView *listview = findItem(canvas->rootObject(), "list"); @@ -1174,7 +1174,7 @@ void tst_QDeclarativeListView::positionViewAtIndex() TestObject *testObject = new TestObject; ctxt->setContextProperty("testObject", testObject); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml")); qApp->processEvents(); QDeclarativeListView *listview = findItem(canvas->rootObject(), "list"); @@ -1333,7 +1333,7 @@ void tst_QDeclarativeListView::propertyChanges() { QDeclarativeView *canvas = createView(); QVERIFY(canvas); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml")); QDeclarativeListView *listView = canvas->rootObject()->findChild("listView"); QVERIFY(listView); @@ -1401,7 +1401,7 @@ void tst_QDeclarativeListView::componentChanges() { QDeclarativeView *canvas = createView(); QVERIFY(canvas); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml")); QDeclarativeListView *listView = canvas->rootObject()->findChild("listView"); QVERIFY(listView); @@ -1449,7 +1449,7 @@ void tst_QDeclarativeListView::modelChanges() { QDeclarativeView *canvas = createView(); QVERIFY(canvas); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychanges.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/propertychangestest.qml")); QDeclarativeListView *listView = canvas->rootObject()->findChild("listView"); QVERIFY(listView); diff --git a/tests/auto/declarative/qdeclarativeparticles/data/particlemotion.qml b/tests/auto/declarative/qdeclarativeparticles/data/particlemotion.qml deleted file mode 100644 index f1e4909..0000000 --- a/tests/auto/declarative/qdeclarativeparticles/data/particlemotion.qml +++ /dev/null @@ -1,35 +0,0 @@ -import Qt 4.6 -import Qt.labs.particles 1.0 - -Rectangle { - width: 240 - height: 320 - color: "black" - Particles { - objectName: "particles" - anchors.fill: parent - width: 1 - height: 1 - source: "particle.png" - lifeSpan: 5000 - count: 200 - angle: 270 - angleDeviation: 45 - velocity: 50 - velocityDeviation: 30 - ParticleMotionGravity { - objectName: "motionGravity" - yattractor: 1000 - xattractor: 0 - acceleration: 25 - } - } - resources: [ - ParticleMotionWander { - objectName: "motionWander" - xvariance: 30 - yvariance: 30 - pace: 100 - } - ] -} diff --git a/tests/auto/declarative/qdeclarativeparticles/data/particlemotiontest.qml b/tests/auto/declarative/qdeclarativeparticles/data/particlemotiontest.qml new file mode 100644 index 0000000..f1e4909 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeparticles/data/particlemotiontest.qml @@ -0,0 +1,35 @@ +import Qt 4.6 +import Qt.labs.particles 1.0 + +Rectangle { + width: 240 + height: 320 + color: "black" + Particles { + objectName: "particles" + anchors.fill: parent + width: 1 + height: 1 + source: "particle.png" + lifeSpan: 5000 + count: 200 + angle: 270 + angleDeviation: 45 + velocity: 50 + velocityDeviation: 30 + ParticleMotionGravity { + objectName: "motionGravity" + yattractor: 1000 + xattractor: 0 + acceleration: 25 + } + } + resources: [ + ParticleMotionWander { + objectName: "motionWander" + xvariance: 30 + yvariance: 30 + pace: 100 + } + ] +} diff --git a/tests/auto/declarative/qdeclarativeparticles/data/particles.qml b/tests/auto/declarative/qdeclarativeparticles/data/particles.qml deleted file mode 100644 index 4f168a9..0000000 --- a/tests/auto/declarative/qdeclarativeparticles/data/particles.qml +++ /dev/null @@ -1,17 +0,0 @@ -import Qt 4.6 -import Qt.labs.particles 1.0 - -Rectangle{ - width: 100 - height: 100 - color: "black" - objectName: "rect" - Particles { id: particles - objectName: "particles" - width:1; height:1; anchors.centerIn: parent; opacity: 1 - lifeSpan: 100; lifeSpanDeviation: 20; count:1000; - fadeInDuration: 20; fadeOutDuration: 20; emissionRate: 1000 - angle: 0; angleDeviation: 360; velocity: 500; velocityDeviation:30 - source: "particle.png" - } -} diff --git a/tests/auto/declarative/qdeclarativeparticles/data/particlestest.qml b/tests/auto/declarative/qdeclarativeparticles/data/particlestest.qml new file mode 100644 index 0000000..4f168a9 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeparticles/data/particlestest.qml @@ -0,0 +1,17 @@ +import Qt 4.6 +import Qt.labs.particles 1.0 + +Rectangle{ + width: 100 + height: 100 + color: "black" + objectName: "rect" + Particles { id: particles + objectName: "particles" + width:1; height:1; anchors.centerIn: parent; opacity: 1 + lifeSpan: 100; lifeSpanDeviation: 20; count:1000; + fadeInDuration: 20; fadeOutDuration: 20; emissionRate: 1000 + angle: 0; angleDeviation: 360; velocity: 500; velocityDeviation:30 + source: "particle.png" + } +} diff --git a/tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp b/tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp index f4e9a27..093190c 100644 --- a/tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp +++ b/tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp @@ -65,7 +65,7 @@ tst_QDeclarativeParticles::tst_QDeclarativeParticles() void tst_QDeclarativeParticles::properties() { - QDeclarativeView *canvas = createView(SRCDIR "/data/particles.qml"); + QDeclarativeView *canvas = createView(SRCDIR "/data/particlestest.qml"); QVERIFY(canvas->rootObject()); QObject* particles = canvas->rootObject()->findChild("particles"); @@ -104,7 +104,7 @@ void tst_QDeclarativeParticles::properties() void tst_QDeclarativeParticles::motionGravity() { - QDeclarativeView *canvas = createView(SRCDIR "/data/particlemotion.qml"); + QDeclarativeView *canvas = createView(SRCDIR "/data/particlemotiontest.qml"); QVERIFY(canvas->rootObject()); QObject* particles = canvas->rootObject()->findChild("particles"); @@ -144,7 +144,7 @@ void tst_QDeclarativeParticles::motionGravity() void tst_QDeclarativeParticles::motionWander() { - QDeclarativeView *canvas = createView(SRCDIR "/data/particlemotion.qml"); + QDeclarativeView *canvas = createView(SRCDIR "/data/particlemotiontest.qml"); QVERIFY(canvas->rootObject()); QObject* particles = canvas->rootObject()->findChild("particles"); @@ -192,7 +192,7 @@ void tst_QDeclarativeParticles::motionWander() void tst_QDeclarativeParticles::runs() { - QDeclarativeView *canvas = createView(SRCDIR "/data/particles.qml"); + QDeclarativeView *canvas = createView(SRCDIR "/data/particlestest.qml"); QVERIFY(canvas->rootObject()); QObject* particles = canvas->rootObject()->findChild("particles"); diff --git a/tests/auto/declarative/qdeclarativepathview/data/path.qml b/tests/auto/declarative/qdeclarativepathview/data/path.qml deleted file mode 100644 index 7e82a48..0000000 --- a/tests/auto/declarative/qdeclarativepathview/data/path.qml +++ /dev/null @@ -1,14 +0,0 @@ -import Qt 4.6 - -Path { - startX: 120; startY: 100 - - PathAttribute { name: "scale"; value: 1.0 } - PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 } - PathPercent { value: 0.3 } - PathLine { x: 120; y: 100 } - PathCubic { - x: 180; y: 0; control1X: -10; control1Y: 90 - control2X: 210; control2Y: 90 - } -} diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathtest.qml b/tests/auto/declarative/qdeclarativepathview/data/pathtest.qml new file mode 100644 index 0000000..7e82a48 --- /dev/null +++ b/tests/auto/declarative/qdeclarativepathview/data/pathtest.qml @@ -0,0 +1,14 @@ +import Qt 4.6 + +Path { + startX: 120; startY: 100 + + PathAttribute { name: "scale"; value: 1.0 } + PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 } + PathPercent { value: 0.3 } + PathLine { x: 120; y: 100 } + PathCubic { + x: 180; y: 0; control1X: -10; control1Y: 90 + control2X: 210; control2Y: 90 + } +} diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview.qml deleted file mode 100644 index ae0c86a..0000000 --- a/tests/auto/declarative/qdeclarativepathview/data/pathview.qml +++ /dev/null @@ -1,75 +0,0 @@ -import Qt 4.6 - -Rectangle { - id: root - property int currentA: -1 - property int currentB: -1 - width: 240 - height: 320 - color: "#ffffff" - resources: [ - Component { - id: delegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 20 - width: 60 - color: PathView.isCurrentItem ? "lightsteelblue" : "white" - border.color: "black" - Text { - text: index - } - Text { - x: 20 - id: textName - objectName: "textName" - text: name - } - Text { - x: 40 - id: textNumber - objectName: "textNumber" - text: number - } - PathView.onCurrentItemChanged: { - if (PathView.isCurrentItem) { - root.currentA = index; - root.currentB = wrapper.PathView.view.currentIndex; - } - } - } - } - ] - PathView { - id: view - objectName: "view" - width: 240 - height: 320 - model: testModel - delegate: delegate - snapPosition: 0.0001 - path: Path { - startY: 120 - startX: 160 - PathQuad { - y: 120 - x: 80 - controlY: 330 - controlX: 100 - } - PathLine { - y: 160 - x: 20 - } - PathCubic { - y: 120 - x: 160 - control1Y: 0 - control1X: 100 - control2Y: 000 - control2X: 200 - } - } - } -} diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml b/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml new file mode 100644 index 0000000..ae0c86a --- /dev/null +++ b/tests/auto/declarative/qdeclarativepathview/data/pathview0.qml @@ -0,0 +1,75 @@ +import Qt 4.6 + +Rectangle { + id: root + property int currentA: -1 + property int currentB: -1 + width: 240 + height: 320 + color: "#ffffff" + resources: [ + Component { + id: delegate + Rectangle { + id: wrapper + objectName: "wrapper" + height: 20 + width: 60 + color: PathView.isCurrentItem ? "lightsteelblue" : "white" + border.color: "black" + Text { + text: index + } + Text { + x: 20 + id: textName + objectName: "textName" + text: name + } + Text { + x: 40 + id: textNumber + objectName: "textNumber" + text: number + } + PathView.onCurrentItemChanged: { + if (PathView.isCurrentItem) { + root.currentA = index; + root.currentB = wrapper.PathView.view.currentIndex; + } + } + } + } + ] + PathView { + id: view + objectName: "view" + width: 240 + height: 320 + model: testModel + delegate: delegate + snapPosition: 0.0001 + path: Path { + startY: 120 + startX: 160 + PathQuad { + y: 120 + x: 80 + controlY: 330 + controlX: 100 + } + PathLine { + y: 160 + x: 20 + } + PathCubic { + y: 120 + x: 160 + control1Y: 0 + control1X: 100 + control2Y: 000 + control2X: 200 + } + } + } +} diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp index cc1a8d5..c16c46f 100644 --- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp +++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp @@ -213,7 +213,7 @@ void tst_QDeclarativePathView::items() QDeclarativeContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview0.qml")); qApp->processEvents(); QDeclarativePathView *pathview = findItem(canvas->rootObject(), "view"); @@ -272,7 +272,7 @@ void tst_QDeclarativePathView::pathview3() void tst_QDeclarativePathView::path() { QDeclarativeEngine engine; - QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/path.qml")); + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/pathtest.qml")); QDeclarativePath *obj = qobject_cast(c.create()); QVERIFY(obj != 0); @@ -407,7 +407,7 @@ void tst_QDeclarativePathView::pathMoved() QDeclarativeContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview0.qml")); qApp->processEvents(); QDeclarativePathView *pathview = findItem(canvas->rootObject(), "view"); @@ -448,7 +448,7 @@ void tst_QDeclarativePathView::setCurrentIndex() QDeclarativeContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathview0.qml")); qApp->processEvents(); QDeclarativePathView *pathview = findItem(canvas->rootObject(), "view"); diff --git a/tests/auto/declarative/qdeclarativepositioners/data/grid.qml b/tests/auto/declarative/qdeclarativepositioners/data/grid.qml deleted file mode 100644 index 830df6a..0000000 --- a/tests/auto/declarative/qdeclarativepositioners/data/grid.qml +++ /dev/null @@ -1,39 +0,0 @@ -import Qt 4.6 - -Item { - width: 640 - height: 480 - Grid { - columns: 3 - Rectangle { - objectName: "one" - color: "red" - width: 50 - height: 50 - } - Rectangle { - objectName: "two" - color: "green" - width: 20 - height: 50 - } - Rectangle { - objectName: "three" - color: "blue" - width: 50 - height: 20 - } - Rectangle { - objectName: "four" - color: "cyan" - width: 50 - height: 50 - } - Rectangle { - objectName: "five" - color: "magenta" - width: 10 - height: 10 - } - } -} diff --git a/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml b/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml new file mode 100644 index 0000000..830df6a --- /dev/null +++ b/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml @@ -0,0 +1,39 @@ +import Qt 4.6 + +Item { + width: 640 + height: 480 + Grid { + columns: 3 + Rectangle { + objectName: "one" + color: "red" + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + color: "green" + width: 20 + height: 50 + } + Rectangle { + objectName: "three" + color: "blue" + width: 50 + height: 20 + } + Rectangle { + objectName: "four" + color: "cyan" + width: 50 + height: 50 + } + Rectangle { + objectName: "five" + color: "magenta" + width: 10 + height: 10 + } + } +} diff --git a/tests/auto/declarative/qdeclarativepositioners/data/propertychanges.qml b/tests/auto/declarative/qdeclarativepositioners/data/propertychanges.qml deleted file mode 100644 index 4370a18..0000000 --- a/tests/auto/declarative/qdeclarativepositioners/data/propertychanges.qml +++ /dev/null @@ -1,39 +0,0 @@ -import Qt 4.6 - -Grid { - id: myGrid - - width: 270 - height: 270 - x: 3 - y: 3 - columns: 4 - spacing: 3 - - add: columnTransition - move: columnTransition - - Repeater { - model: 20 - Rectangle { color: "black"; width: 50; height: 50 } - } - - data: [ - Transition { - id: rowTransition - objectName: "rowTransition" - NumberAnimation { - properties: "x,y"; - easing.type: "OutInCubic" - } - }, - Transition { - id: columnTransition - objectName: "columnTransition" - NumberAnimation { - properties: "x,y"; - easing.type: "OutInCubic" - } - } - ] -} diff --git a/tests/auto/declarative/qdeclarativepositioners/data/propertychangestest.qml b/tests/auto/declarative/qdeclarativepositioners/data/propertychangestest.qml new file mode 100644 index 0000000..4370a18 --- /dev/null +++ b/tests/auto/declarative/qdeclarativepositioners/data/propertychangestest.qml @@ -0,0 +1,39 @@ +import Qt 4.6 + +Grid { + id: myGrid + + width: 270 + height: 270 + x: 3 + y: 3 + columns: 4 + spacing: 3 + + add: columnTransition + move: columnTransition + + Repeater { + model: 20 + Rectangle { color: "black"; width: 50; height: 50 } + } + + data: [ + Transition { + id: rowTransition + objectName: "rowTransition" + NumberAnimation { + properties: "x,y"; + easing.type: "OutInCubic" + } + }, + Transition { + id: columnTransition + objectName: "columnTransition" + NumberAnimation { + properties: "x,y"; + easing.type: "OutInCubic" + } + } + ] +} diff --git a/tests/auto/declarative/qdeclarativepositioners/data/repeater.qml b/tests/auto/declarative/qdeclarativepositioners/data/repeater.qml deleted file mode 100644 index 2bc5e94..0000000 --- a/tests/auto/declarative/qdeclarativepositioners/data/repeater.qml +++ /dev/null @@ -1,20 +0,0 @@ -import Qt 4.6 - -Item { - width: 640 - height: 480 - Row { - Repeater{ model: 3; - delegate: Component { - Rectangle { - color: "red" - width: 50 - height: 50 - z: {if(index == 0){2;}else if(index == 1){1;} else{3;}} - objectName: {if(index == 0){"one";}else if(index == 1){"two";} else{"three";}} - - } - } - } - } -} diff --git a/tests/auto/declarative/qdeclarativepositioners/data/repeatertest.qml b/tests/auto/declarative/qdeclarativepositioners/data/repeatertest.qml new file mode 100644 index 0000000..2bc5e94 --- /dev/null +++ b/tests/auto/declarative/qdeclarativepositioners/data/repeatertest.qml @@ -0,0 +1,20 @@ +import Qt 4.6 + +Item { + width: 640 + height: 480 + Row { + Repeater{ model: 3; + delegate: Component { + Rectangle { + color: "red" + width: 50 + height: 50 + z: {if(index == 0){2;}else if(index == 1){1;} else{3;}} + objectName: {if(index == 0){"one";}else if(index == 1){"two";} else{"three";}} + + } + } + } + } +} diff --git a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp index d23d74c..0e1fee2 100644 --- a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp +++ b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp @@ -239,7 +239,7 @@ void tst_QDeclarativePositioners::test_vertical_animated() void tst_QDeclarativePositioners::test_grid() { - QDeclarativeView *canvas = createView(SRCDIR "/data/grid.qml"); + QDeclarativeView *canvas = createView(SRCDIR "/data/gridtest.qml"); QDeclarativeRectangle *one = canvas->rootObject()->findChild("one"); QVERIFY(one != 0); @@ -365,9 +365,10 @@ void tst_QDeclarativePositioners::test_grid_animated() } void tst_QDeclarativePositioners::test_propertychanges() { - QDeclarativeView *canvas = createView(SRCDIR "/data/propertychanges.qml"); + QDeclarativeView *canvas = createView(SRCDIR "/data/propertychangestest.qml"); QDeclarativeGrid *grid = qobject_cast(canvas->rootObject()); + QVERIFY(grid != 0); QDeclarativeTransition *rowTransition = canvas->rootObject()->findChild("rowTransition"); QDeclarativeTransition *columnTransition = canvas->rootObject()->findChild("columnTransition"); @@ -421,7 +422,7 @@ void tst_QDeclarativePositioners::test_propertychanges() void tst_QDeclarativePositioners::test_repeater() { - QDeclarativeView *canvas = createView(SRCDIR "/data/repeater.qml"); + QDeclarativeView *canvas = createView(SRCDIR "/data/repeatertest.qml"); QDeclarativeRectangle *one = canvas->rootObject()->findChild("one"); QVERIFY(one != 0); diff --git a/tests/auto/declarative/qdeclarativerepeater/data/repeater.qml b/tests/auto/declarative/qdeclarativerepeater/data/repeater.qml deleted file mode 100644 index 7d83230..0000000 --- a/tests/auto/declarative/qdeclarativerepeater/data/repeater.qml +++ /dev/null @@ -1,28 +0,0 @@ -import Qt 4.6 - -Rectangle { - id: container - objectName: "container" - width: 240 - height: 320 - color: "white" - Text { - text: "Zero" - } - Repeater { - id: repeater - objectName: "repeater" - width: 240 - height: 320 - model: testData - Component { - Text { - y: index*20 - text: modelData - } - } - } - Text { - text: "Last" - } -} diff --git a/tests/auto/declarative/qdeclarativerepeater/data/repeater1.qml b/tests/auto/declarative/qdeclarativerepeater/data/repeater1.qml new file mode 100644 index 0000000..7d83230 --- /dev/null +++ b/tests/auto/declarative/qdeclarativerepeater/data/repeater1.qml @@ -0,0 +1,28 @@ +import Qt 4.6 + +Rectangle { + id: container + objectName: "container" + width: 240 + height: 320 + color: "white" + Text { + text: "Zero" + } + Repeater { + id: repeater + objectName: "repeater" + width: 240 + height: 320 + model: testData + Component { + Text { + y: index*20 + text: modelData + } + } + } + Text { + text: "Last" + } +} diff --git a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp index 7da9454..09c4879 100644 --- a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp +++ b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp @@ -224,7 +224,7 @@ void tst_QDeclarativeRepeater::stringList() QDeclarativeContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testData", data); - canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/repeater.qml")); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/repeater1.qml")); qApp->processEvents(); QDeclarativeRepeater *repeater = findItem(canvas->rootObject(), "repeater"); diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges.qml deleted file mode 100644 index 7dce889..0000000 --- a/tests/auto/declarative/qdeclarativestates/data/anchorChanges.qml +++ /dev/null @@ -1,23 +0,0 @@ -import Qt 4.6 - -Rectangle { - id: container - width: 200; height: 200 - Rectangle { - id: myRect - objectName: "MyRect" - width: 50; height: 50 - color: "green"; - anchors.left: parent.left - anchors.leftMargin: 5 - } - states: State { - name: "right" - AnchorChanges { - id: ancCh - target: myRect; - reset: "left" - right: container.right - } - } -} diff --git a/tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml b/tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml new file mode 100644 index 0000000..7dce889 --- /dev/null +++ b/tests/auto/declarative/qdeclarativestates/data/anchorChanges1.qml @@ -0,0 +1,23 @@ +import Qt 4.6 + +Rectangle { + id: container + width: 200; height: 200 + Rectangle { + id: myRect + objectName: "MyRect" + width: 50; height: 50 + color: "green"; + anchors.left: parent.left + anchors.leftMargin: 5 + } + states: State { + name: "right" + AnchorChanges { + id: ancCh + target: myRect; + reset: "left" + right: container.right + } + } +} diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange.qml deleted file mode 100644 index b8c7818..0000000 --- a/tests/auto/declarative/qdeclarativestates/data/parentChange.qml +++ /dev/null @@ -1,37 +0,0 @@ -import Qt 4.6 - -Rectangle { - width: 400; height: 400 - Item { - x: 10; y: 10 - Rectangle { - id: myRect - objectName: "MyRect" - x: 5 - width: 100; height: 100 - color: "red" - } - } - MouseArea { - id: clickable - anchors.fill: parent - } - - Item { - x: -100; y: -50 - Item { - id: newParent - objectName: "NewParent" - x: 248; y: 360 - } - } - - states: State { - name: "reparented" - when: clickable.pressed - ParentChange { - target: myRect - parent: newParent - } - } -} diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange1.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange1.qml new file mode 100644 index 0000000..b8c7818 --- /dev/null +++ b/tests/auto/declarative/qdeclarativestates/data/parentChange1.qml @@ -0,0 +1,37 @@ +import Qt 4.6 + +Rectangle { + width: 400; height: 400 + Item { + x: 10; y: 10 + Rectangle { + id: myRect + objectName: "MyRect" + x: 5 + width: 100; height: 100 + color: "red" + } + } + MouseArea { + id: clickable + anchors.fill: parent + } + + Item { + x: -100; y: -50 + Item { + id: newParent + objectName: "NewParent" + x: 248; y: 360 + } + } + + states: State { + name: "reparented" + when: clickable.pressed + ParentChange { + target: myRect + parent: newParent + } + } +} diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp index c16a870..fe7ec15 100644 --- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp +++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp @@ -441,7 +441,7 @@ void tst_qdeclarativestates::parentChange() QDeclarativeEngine engine; { - QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange.qml"); + QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange1.qml"); QDeclarativeRectangle *rect = qobject_cast(rectComponent.create()); QVERIFY(rect != 0); @@ -546,7 +546,7 @@ void tst_qdeclarativestates::anchorChanges() { QDeclarativeEngine engine; - QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges.qml"); + QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/anchorChanges1.qml"); QDeclarativeRectangle *rect = qobject_cast(rectComponent.create()); QVERIFY(rect != 0); -- cgit v0.12