aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickstates/data/legalTempState.qml
blob: a93860f5cc5aff703546790e1179afbcfbec171d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import QtQuick 2.0

Rectangle {
    id: card
    width: 100; height: 100

    states: [
        State {
            name: "placed"
            onCompleted: card.state = "idle"
            StateChangeScript { script: console.log("entering placed") }
        },
        State {
            name: "idle"
            StateChangeScript { script: console.log("entering idle") }
        }
    ]

    MouseArea {
        anchors.fill: parent
        onClicked: card.state = "placed"
    }
}