aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickanimations/data/scriptActionCrash.qml
blob: ace63918d80c3ebe0b5b6807f91d7ebf8ee4b73f (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
// Copyright (C) 2016 Jolla Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick 2.0

Item {
    width: 400; height: 400

    Component.onCompleted: rect.state = "wide"

    Rectangle {
        id: rect

        color: "green"
        width: 50
        height: 50
        anchors.centerIn: parent

        states: State {
            name: "wide"
            PropertyChanges {
                target: rect
                width: 100
            }
        }
        transitions: Transition {
            to: "wide"
            SequentialAnimation {
                NumberAnimation { duration: 200; property: "width" }
                ScriptAction { script: { rect.state = ""; rect.state = "wide" } }
            }
        }
    }
}