Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativegridview / data / gridview-enforcerange.qml
1 import QtQuick 1.1
2
3 Rectangle {
4     width: 240
5     height: 320
6     color: "#ffffff"
7     Component {
8         id: myDelegate
9         Item {
10             id: wrapper
11             objectName: "wrapper"
12             height: 100
13             width: 100
14             Text {
15                 text: index
16             }
17             Text {
18                 y: 25
19                 id: textName
20                 objectName: "textName"
21                 text: name
22             }
23             Text {
24                 y: 50
25                 id: textNumber
26                 objectName: "textNumber"
27                 text: number
28             }
29             Text {
30                 y: 75
31                 text: wrapper.y
32             }
33         }
34     }
35
36     Component {
37         id: myHighlight
38         Rectangle {
39             color: "lightsteelblue"
40         }
41     }
42         
43     GridView {
44         id: grid
45         objectName: "grid"
46         width: 240
47         height: 320
48         model: testModel
49         delegate: myDelegate
50         highlight: myHighlight
51         flow: (testTopToBottom == true) ? GridView.TopToBottom : GridView.LeftToRight
52         layoutDirection: (testRightToLeft == true) ? Qt.RightToLeft : Qt.LeftToRight
53         preferredHighlightBegin: 100
54         preferredHighlightEnd: 100
55         highlightRangeMode: "StrictlyEnforceRange"
56         focus: true
57     }
58 }