aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qtquick2/qquickpathview/data/pathline.qml
blob: 4c1c785bcef21b50bf7c24dda9ff774314efcb6d (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
38
39
40
41
42
43
44
45
46
47
48
import QtQuick 2.0

Rectangle {
    id: app
    width: 360
    height: 360

    PathView {
        id: pathView
        objectName: "view"
        x: (app.width-pathView.width)/2
        y: 100
        width: 240
        height: 100

        model: testModel

        Rectangle {
            anchors.fill: parent
            color: "white"
            border.color: "black"
        }
        preferredHighlightBegin: 0.5
        preferredHighlightEnd: 0.5

        delegate: Rectangle {
            objectName: "wrapper"
            width: 100
            height: 100
            color: PathView.isCurrentItem ? "red" : "yellow"
            Text {
                text: index
                anchors.centerIn: parent
            }
            z: (PathView.isCurrentItem?1:0)
        }
        path: Path {
            id: path
            startX: -100+pathView.width/2
            startY: pathView.height/2
            PathLine {
                id: line
                x: 100+pathView.width/2
                y: pathView.height/2
            }
        }
    }
}