Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativelistview / data / strictlyenforcerange.qml
1 import QtQuick 1.0
2
3 ListView {
4     id: list
5     objectName: "list"
6     width: 320
7     height: 480
8
9     function fillModel() {
10         list.model.append({"col": "red"});
11         list.currentIndex = list.count-1
12         list.model.append({"col": "blue"});
13         list.currentIndex = list.count-1
14         list.model.append({"col": "green"});
15         list.currentIndex = list.count-1
16     }
17
18     model: ListModel { id: listModel }  // empty model
19     delegate: Rectangle { id: wrapper; objectName: "wrapper"; color: col; width: 300; height: 400 }
20     orientation: "Horizontal"
21     snapMode: "SnapToItem"
22     cacheBuffer: 1000
23
24     preferredHighlightBegin: 10
25     preferredHighlightEnd: 10
26
27     highlightRangeMode: "StrictlyEnforceRange"
28     focus: true
29 }