aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickpathview/data
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2012-07-18 10:36:17 +1000
committerQt by Nokia <qt-info@nokia.com>2012-07-23 03:30:23 +0200
commit0fc361f96b06ba318e70610e46beb421753cae9d (patch)
tree8b5ea97dc869f3896f7fc565fc15def3ad131254 /tests/auto/quick/qquickpathview/data
parent33fcc79a88fbc66a3a714913392a331f2bb601b3 (diff)
Changing PathView model after componentComplete should reset position
If the model is changed after the component is completed, the offset and currentIndex should be reset to 0. Change-Id: Ie36eb0c17ce6602c6ae15b5ee7aeb8b1a6e7854b Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquickpathview/data')
-rw-r--r--tests/auto/quick/qquickpathview/data/initialCurrentIndex.qml60
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickpathview/data/initialCurrentIndex.qml b/tests/auto/quick/qquickpathview/data/initialCurrentIndex.qml
new file mode 100644
index 0000000000..86f7fe4246
--- /dev/null
+++ b/tests/auto/quick/qquickpathview/data/initialCurrentIndex.qml
@@ -0,0 +1,60 @@
+import QtQuick 2.0
+
+PathView {
+ id: photoPathView
+ y: 100; width: 800; height: 330; pathItemCount: 4
+ currentIndex: 3
+ dragMargin: 24
+ preferredHighlightBegin: 0.50
+ preferredHighlightEnd: 0.50
+
+ path: Path {
+ startX: -50; startY: 40;
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: -45 }
+
+ PathCubic {
+ x: 400; y: 220
+ control1X: 140; control1Y: 40
+ control2X: 210; control2Y: 220
+ }
+
+ PathAttribute { name: "scale"; value: 1.2 }
+ PathAttribute { name: "angle"; value: 0 }
+
+ PathCubic {
+ x: 850; y: 40
+ control2X: 660; control2Y: 40
+ control1X: 590; control1Y: 220
+ }
+
+ PathAttribute { name: "scale"; value: 0.5 }
+ PathAttribute { name: "angle"; value: 45 }
+ }
+
+ model: ListModel {
+ id: rssModel
+ ListElement { lColor: "red" }
+ ListElement { lColor: "green" }
+ ListElement { lColor: "yellow" }
+ ListElement { lColor: "blue" }
+ ListElement { lColor: "purple" }
+ ListElement { lColor: "gray" }
+ ListElement { lColor: "brown" }
+ ListElement { lColor: "thistle" }
+ }
+
+ delegate: Component {
+ id: photoDelegate
+ Rectangle {
+ id: wrapper
+ width: 85; height: 85; color: lColor
+
+ transform: Rotation {
+ id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2
+ axis.y: 1; axis.z: 0
+ }
+ }
+ }
+}