aboutsummaryrefslogtreecommitdiffstats
path: root/tests/baseline/scenegraph/data/shape/shape_trim.qml
blob: ad9bd8e8db3c1ddf17444319a43a50478b98f6a9 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import QtQuick
import QtQuick.Shapes

Rectangle {
    width: 320
    height: 480
    color: "lightyellow"

    ListModel {
        id: renderers
        ListElement { renderer: Shape.GeometryRenderer }
        ListElement { renderer: Shape.CurveRenderer }
    }

    Row {
        Repeater {
            model: renderers
            Column {
                Repeater {
                    model: 4
                    Item {
                        width: 160
                        height: 120

                        Shape {
                            id: shape1
                            anchors.fill: parent
                            preferredRendererType: renderer

                            ShapePath {
                                id: path2
                                strokeWidth: 5
                                strokeColor: "blue"
                                fillColor: "transparent"
                                capStyle: ShapePath.RoundCap
                                joinStyle: ShapePath.RoundJoin

                                PathAngleArc {
                                    centerX: shape1.width / 2
                                    centerY: shape1.height / 2
                                    radiusX: centerX - 10
                                    radiusY: centerY - 10
                                    sweepAngle: 360
                                }

                                trim.start: 0.1
                                trim.end: 0.9
                            }

                            ShapePath {
                                id: path1
                                strokeWidth: 5
                                strokeColor: "black"
                                fillColor: "orange"

                                startX: 30; startY: 100
                                PathCubic {
                                    x: 130; y: 100
                                    control1X: 30; control1Y: 15
                                    control2X: -30; control2Y: 30
                                }
                                PathLine {
                                    x: 50; y: 80
                                }
                                PathQuad {
                                    x: path1.startX; y: path1.startY
                                    relativeControlX: 30
                                    relativeControlY: 15
                                }

                            }

                            Timer {
                                running: true
                                interval: 50
                                onTriggered: {
                                    path1.trim.start = model.index * 0.2
                                    path1.trim.end = 1 - model.index * 0.2

                                    path2.trim.offset = model.index * -0.3
                                }
                            }


                        }
                    }
                }
            }
        }
    }
}