~ubuntu-branches/ubuntu/saucy/qtdeclarative-opensource-src/saucy

« back to all changes in this revision

Viewing changes to tests/auto/quick/qquickgridview/data/gridview-enforcerange.qml

  • Committer: Package Import Robot
  • Author(s): Timo Jyrinki
  • Date: 2013-02-05 14:17:19 UTC
  • Revision ID: package-import@ubuntu.com-20130205141719-qqeyml8wslpyez52
Tags: upstream-5.0.1
ImportĀ upstreamĀ versionĀ 5.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.0
 
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
}