Add cacheItemCount property to PathView
[profile/ivi/qtdeclarative.git] / tests / auto / quick / qquickpathview / data / pathview3.qml
index ded5a39..4687776 100644 (file)
@@ -2,11 +2,17 @@ import QtQuick 2.0
 
 PathView {
     id: photoPathView
-    y: 100; width: 800; height: 330; pathItemCount: 4; offset: 1
+    property bool enforceRange: true
+    width: 800; height: 330; pathItemCount: 4; offset: 1
     dragMargin: 24
+    highlightRangeMode: enforceRange ? PathView.StrictlyEnforceRange : PathView.NoHighlightRange
     preferredHighlightBegin: 0.50
     preferredHighlightEnd: 0.50
 
+    function addColor(color) {
+        model.append({"lColor":color})
+    }
+
     path: Path {
         startX: -50; startY: 40;
 
@@ -33,7 +39,6 @@ PathView {
     }
 
     model: ListModel {
-        id: rssModel
         ListElement { lColor: "red" }
         ListElement { lColor: "green" }
         ListElement { lColor: "yellow" }
@@ -48,12 +53,17 @@ PathView {
         id: photoDelegate
         Rectangle {
             id: wrapper
+            objectName: "wrapper"
             width: 85; height: 85; color: lColor
 
+            Text { text: index }
+
             transform: Rotation {
                 id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2
                 axis.y: 1; axis.z: 0
             }
         }
     }
+
+    Text { text: "Offset: " + photoPathView.offset }
 }