summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@theqtcompany.com>2016-08-24 16:28:48 +0200
committerThomas Hartmann <Thomas.Hartmann@theqtcompany.com>2016-09-02 14:28:10 +0000
commit64c9fba626f82d7f9e61c5f84a15be4ff01e742b (patch)
tree23ad4c9d8f87bc7c090ee48f01caab7af3cac89e /examples
parent1737bbbdff5e12b73e0bbf52d3e361aa520538d6 (diff)
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 <ulf.hermann@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/scxml/trafficlight-common/Lights.ui.qml11
-rw-r--r--examples/scxml/trafficlight-common/TrafficLight.qml16
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");
}
}