Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativelistview / data / listview-initCurrent.qml
1 import QtQuick 1.0
2
3 Rectangle {
4     property int current: list.currentIndex
5     width: 240
6     height: 320
7     color: "#ffffff"
8     resources: [
9         Component {
10             id: myDelegate
11             Rectangle {
12                 id: wrapper
13                 objectName: "wrapper"
14                 height: 20
15                 width: 240
16                 Text {
17                     text: index
18                 }
19                 Text {
20                     x: 30
21                     id: textName
22                     objectName: "textName"
23                     text: name
24                 }
25                 Text {
26                     x: 120
27                     id: textNumber
28                     objectName: "textNumber"
29                     text: number
30                 }
31                 Text {
32                     x: 200
33                     text: wrapper.y
34                 }
35                 color: ListView.isCurrentItem ? "lightsteelblue" : "white"
36             }
37         }
38     ]
39     ListView {
40         id: list
41         objectName: "list"
42         focus: true
43         currentIndex: 20
44         width: 240
45         height: 320
46         keyNavigationWraps: testWrap
47         delegate: myDelegate
48         highlightMoveSpeed: 1000
49         model: testModel
50     }
51 }