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

Item {
    id: root
    property int number: 2
    property int stateChangeCounter: 0

    Item {
        id: item
        onStateChanged: ++stateChangeCounter
        states: [
            State {
                name: "n1"
                when: root.number === 1
            },
            State {
                name: "n2"
                when: root.number === 2
            }
        ]
    }
}