From 64c9fba626f82d7f9e61c5f84a15be4ff01e742b Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 24 Aug 2016 16:28:48 +0200 Subject: Example: Final cleanup of trafficlights * The color for Window is not visible * The MouseArea to quit the application is not required * Removing unused alias properties Change-Id: Id7647e1a588581f238b2554b0c9d1c955757acdd Reviewed-by: Ulf Hermann --- examples/scxml/trafficlight-common/Lights.ui.qml | 11 +---------- examples/scxml/trafficlight-common/TrafficLight.qml | 16 ++-------------- 2 files changed, 3 insertions(+), 24 deletions(-) (limited to 'examples/scxml') 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"); } } -- cgit v1.2.3