summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativemousearea/data/pressedOrdering.qml
blob: 4a80e834659043be97c33c7812881fa3fc671b13 (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
import QtQuick 1.0

Item {
    id: root
    property string value: "base"

    MouseArea {
        id: mouseArea
        width: 200; height: 200
        onClicked: toggleState.state = "toggled"
    }

    StateGroup {
        states: State {
            name: "pressed"
            when: mouseArea.pressed
            PropertyChanges { target: root; value: "pressed" }
        }
    }

    StateGroup {
        id: toggleState
        states: State {
            name: "toggled"
            PropertyChanges { target: root; value: "toggled" }
        }
    }
}