aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/painterpathquickshape/quadraticCurve.qml
blob: 9199302c1a3fe8b4dc5852dba8cda8355ae2ca55 (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
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick
import QtQuick.Shapes

Item {
    ControlledShape {
        id: shape
        anchors.fill: parent
        strokeWidth: 4
        strokeColor: "black"
        fillColor: "transparent"

        startX: 50
        startY: 50

        delegate: [
            PathQuad {
                x: 150
                y: 50
                controlX: cp.x
                controlY: cp.y
            }
        ]
    }

    Rectangle {
        id: cp
        color: "red"
        width: 10
        height: 10
        SequentialAnimation on x {
            loops: Animation.Infinite
            NumberAnimation {
                from: 0
                to: shape.width - cp.width
                duration: 5000
            }
            NumberAnimation {
                from: shape.width - cp.width
                to: 0
                duration: 5000
            }
        }
    }
}