aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview/data
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquicklistview/data')
-rw-r--r--tests/auto/quick/qquicklistview/data/displacedTransitions.qml35
-rw-r--r--tests/auto/quick/qquicklistview/data/flickBeyondBoundsBug.qml43
-rw-r--r--tests/auto/quick/qquicklistview/data/multipleTransitions.qml2
3 files changed, 79 insertions, 1 deletions
diff --git a/tests/auto/quick/qquicklistview/data/displacedTransitions.qml b/tests/auto/quick/qquicklistview/data/displacedTransitions.qml
index cc7892e930..964ded10ee 100644
--- a/tests/auto/quick/qquicklistview/data/displacedTransitions.qml
+++ b/tests/auto/quick/qquicklistview/data/displacedTransitions.qml
@@ -53,6 +53,17 @@ Rectangle {
property int targetTransitionsDone
property int displaceTransitionsDone
+ property var displacedTargetIndexes: new Array()
+ property var displacedTargetItems: new Array()
+
+ // for QDeclarativeListProperty types
+ function copyList(propList) {
+ var temp = new Array()
+ for (var i=0; i<propList.length; i++)
+ temp.push(propList[i])
+ return temp
+ }
+
objectName: "list"
focus: true
anchors.centerIn: parent
@@ -70,6 +81,12 @@ Rectangle {
id: displaced
enabled: displacedEnabled
SequentialAnimation {
+ ScriptAction {
+ script: {
+ list.displacedTargetIndexes.push(displaced.ViewTransition.targetIndexes)
+ list.displacedTargetItems.push(list.copyList(displaced.ViewTransition.targetItems))
+ }
+ }
ParallelAnimation {
NumberAnimation { properties: "x"; to: displaced_transitionVia.x; duration: root.duration }
NumberAnimation { properties: "y"; to: displaced_transitionVia.y; duration: root.duration }
@@ -83,6 +100,12 @@ Rectangle {
id: addDisplaced
enabled: addDisplacedEnabled
SequentialAnimation {
+ ScriptAction {
+ script: {
+ list.displacedTargetIndexes.push(addDisplaced.ViewTransition.targetIndexes)
+ list.displacedTargetItems.push(list.copyList(addDisplaced.ViewTransition.targetItems))
+ }
+ }
ParallelAnimation {
NumberAnimation { properties: "x"; to: addDisplaced_transitionVia.x; duration: root.duration }
NumberAnimation { properties: "y"; to: addDisplaced_transitionVia.y; duration: root.duration }
@@ -96,6 +119,12 @@ Rectangle {
id: moveDisplaced
enabled: moveDisplacedEnabled
SequentialAnimation {
+ ScriptAction {
+ script: {
+ list.displacedTargetIndexes.push(moveDisplaced.ViewTransition.targetIndexes)
+ list.displacedTargetItems.push(list.copyList(moveDisplaced.ViewTransition.targetItems))
+ }
+ }
ParallelAnimation {
NumberAnimation { properties: "x"; to: moveDisplaced_transitionVia.x; duration: root.duration }
NumberAnimation { properties: "y"; to: moveDisplaced_transitionVia.y; duration: root.duration }
@@ -109,6 +138,12 @@ Rectangle {
id: removeDisplaced
enabled: removeDisplacedEnabled
SequentialAnimation {
+ ScriptAction {
+ script: {
+ list.displacedTargetIndexes.push(removeDisplaced.ViewTransition.targetIndexes)
+ list.displacedTargetItems.push(list.copyList(removeDisplaced.ViewTransition.targetItems))
+ }
+ }
ParallelAnimation {
NumberAnimation { properties: "x"; to: removeDisplaced_transitionVia.x; duration: root.duration }
NumberAnimation { properties: "y"; to: removeDisplaced_transitionVia.y; duration: root.duration }
diff --git a/tests/auto/quick/qquicklistview/data/flickBeyondBoundsBug.qml b/tests/auto/quick/qquicklistview/data/flickBeyondBoundsBug.qml
new file mode 100644
index 0000000000..0a1b1a1b64
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/flickBeyondBoundsBug.qml
@@ -0,0 +1,43 @@
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ width: 240
+ height: 320
+ color: "#ffffff"
+
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ height: column.height
+ Column {
+ id: column
+ Text {
+ text: "index: " + index + ", delegate A"
+ Component.onCompleted: height = index % 2 ? 30 : 20
+ }
+ Text {
+ x: 200
+ text: wrapper.y
+ height: 25
+ }
+ }
+ color: ListView.isCurrentItem ? "lightsteelblue" : "#EEEEEE"
+ }
+ }
+ ListView {
+ id: list
+ objectName: "list"
+ focus: true
+ width: 240
+ height: 320
+ model: 2
+ delegate: myDelegate
+ highlightMoveSpeed: 1000
+ highlightResizeSpeed: 1000
+ cacheBuffer: 400
+ }
+ Text { anchors.bottom: parent.bottom; text: list.contentY }
+}
diff --git a/tests/auto/quick/qquicklistview/data/multipleTransitions.qml b/tests/auto/quick/qquicklistview/data/multipleTransitions.qml
index 8264b42b64..68efeea2ec 100644
--- a/tests/auto/quick/qquicklistview/data/multipleTransitions.qml
+++ b/tests/auto/quick/qquicklistview/data/multipleTransitions.qml
@@ -10,7 +10,7 @@ Rectangle {
// interrupting transitions will still produce the correct result)
property int timeBetweenActions: duration / 2
- property int duration: 300
+ property int duration: 100
property int count: list.count