aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickmousearea/data/pressedOrdering.qml
blob: 7aa3098100fc9fcf41f5b2434eb03ea5d96e7ccf (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 2.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" }
        }
    }
}