summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/visual/qmlgraphicsflickable/flickable-vertical.qml
blob: a1885c45bd8f8cf990fe868a77dc5ee6fe25064a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import Qt 4.6

Rectangle {
    color: "lightSteelBlue"
    width: 300; height: 600

    ListModel {
        id: list
        ListElement { dayColor: "steelblue" }
        ListElement { dayColor: "blue" }
        ListElement { dayColor: "yellow" }
        ListElement { dayColor: "purple" }
        ListElement { dayColor: "red" }
        ListElement { dayColor: "green" }
        ListElement { dayColor: "orange" }
    }

    Flickable {
        id: Flick
        anchors.fill: parent; viewportHeight: column.height

        Column {
            id: column
            Repeater {
                model: list
                Rectangle { width: 300; height: 200; color: dayColor }
            }
        }
    }
    Rectangle {
        radius: 3
        x: Flick.width-8
        width: 8
        y: Flick.visibleArea.yPosition * Flick.height
        height: Flick.visibleArea.heightRatio * Flick.height
    }
}