diff options
Diffstat (limited to 'examples/scxml')
-rw-r--r-- | examples/scxml/trafficlight-common/Lights.ui.qml | 11 | ||||
-rw-r--r-- | examples/scxml/trafficlight-common/TrafficLight.qml | 16 |
2 files changed, 3 insertions, 24 deletions
diff --git a/examples/scxml/trafficlight-common/Lights.ui.qml b/examples/scxml/trafficlight-common/Lights.ui.qml index 8a71159..a385eae 100644 --- a/examples/scxml/trafficlight-common/Lights.ui.qml +++ b/examples/scxml/trafficlight-common/Lights.ui.qml @@ -56,21 +56,11 @@ import TrafficLightStateMachine 1.0 Image { id: lights - property alias mouseArea: mouseArea property alias button: button - property alias redLight: redLight - property alias yellowLight: yellowLight - property alias greenLight: greenLight - property TrafficLightStateMachine stateMachine source: "background.png" - MouseArea { - id: mouseArea - anchors.fill: parent - } - Column { y: 40 spacing: 27 @@ -103,6 +93,7 @@ Image { anchors.margins: 20 source: "pause.png" } + states: [ State { name: "Red" diff --git a/examples/scxml/trafficlight-common/TrafficLight.qml b/examples/scxml/trafficlight-common/TrafficLight.qml index 6d8319d..1da3726 100644 --- a/examples/scxml/trafficlight-common/TrafficLight.qml +++ b/examples/scxml/trafficlight-common/TrafficLight.qml @@ -58,7 +58,6 @@ Window { property TrafficLightStateMachine stateMachine visible: true - color: "black" width: lights.width height: lights.height @@ -66,19 +65,8 @@ Window { id: lights stateMachine: root.stateMachine - - mouseArea.onClicked: { - Qt.quit(); - } - - button.onClicked: { - - if (stateMachine.working) - stateMachine.submitEvent("smash") - else - stateMachine.submitEvent("repair") - } - button.source: stateMachine.working ? "pause.png" : "play.png" + + button.onClicked: stateMachine.submitEvent(stateMachine.working ? "smash" : "repair"); } } |