summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@theqtcompany.com>2016-01-21 11:02:53 +0100
committerErik Verbruggen <erik.verbruggen@theqtcompany.com>2016-02-04 10:18:46 +0000
commit291a963477e190540b2b9a6f0a5c8ce836812067 (patch)
tree80761df476982cd860d4aa450e7fee5be4b94d25 /examples
parent706bd3b4960dedf6cd65215f8139f2aaf7ae8ddf (diff)
Change state properties to be booleans and add notify signals.
The state properties now indicate whether a state is active or not. Change-Id: I1b9029056e38debf7cb46411bfe9e7c8ff4eefb7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/invoke-common/MainView.qml6
-rw-r--r--examples/invoke-common/SubView.qml4
-rw-r--r--examples/mediaplayer-common/Mediaplayer.qml2
-rw-r--r--examples/trafficlight-common/TrafficLight.qml10
4 files changed, 11 insertions, 11 deletions
diff --git a/examples/invoke-common/MainView.qml b/examples/invoke-common/MainView.qml
index f456b1b..b623592 100644
--- a/examples/invoke-common/MainView.qml
+++ b/examples/invoke-common/MainView.qml
@@ -70,7 +70,7 @@ Window {
width: parent.width
height: parent.height / 2
onClicked: stateMachine.event_goNowhere()
- enabled: stateMachine.somewhere.active
+ enabled: stateMachine.somewhere
}
Button {
@@ -80,13 +80,13 @@ Window {
height: parent.height / 2
y: parent.height / 2
onClicked: stateMachine.event_goSomewhere()
- enabled: stateMachine.nowhere.active
+ enabled: stateMachine.nowhere
}
}
Loader {
source: "SubView.qml"
- active: stateMachine.somewhere.active
+ active: stateMachine.somewhere
x: parent.width / 2
width: parent.width / 2
diff --git a/examples/invoke-common/SubView.qml b/examples/invoke-common/SubView.qml
index 1b46e2b..8ab3614 100644
--- a/examples/invoke-common/SubView.qml
+++ b/examples/invoke-common/SubView.qml
@@ -53,7 +53,7 @@ import QtQuick 2.5
Item {
Button {
id: here
- enabled: anywhere.here.active
+ enabled: anywhere.here
text: "Go There"
width: parent.width / 2
height: parent.height
@@ -62,7 +62,7 @@ Item {
Button {
id: there
- enabled: anywhere.there.active
+ enabled: anywhere.there
text: "Go Here"
width: parent.width / 2
height: parent.height
diff --git a/examples/mediaplayer-common/Mediaplayer.qml b/examples/mediaplayer-common/Mediaplayer.qml
index 82665ed..d370ae9 100644
--- a/examples/mediaplayer-common/Mediaplayer.qml
+++ b/examples/mediaplayer-common/Mediaplayer.qml
@@ -108,7 +108,7 @@ Window {
anchors.right: parent.right;
anchors.top: parent.top
text: "Stopped"
- color: stateMachine.playing.active ? "green" : "red"
+ color: stateMachine.playing ? "green" : "red"
}
Scxml.StateMachineLoader {
diff --git a/examples/trafficlight-common/TrafficLight.qml b/examples/trafficlight-common/TrafficLight.qml
index c08265e..552e41d 100644
--- a/examples/trafficlight-common/TrafficLight.qml
+++ b/examples/trafficlight-common/TrafficLight.qml
@@ -76,21 +76,21 @@ Window {
id: redLight
anchors.top: parent.top
color: "red"
- visible: stateMachine.red.active || stateMachine.redGoingGreen.active
+ visible: stateMachine.red || stateMachine.redGoingGreen
}
Light {
id: yellowLight
anchors.top: redLight.bottom
color: "yellow"
- visible: stateMachine.yellow.active || stateMachine.blinking.active
+ visible: stateMachine.yellow || stateMachine.blinking
}
Light {
id: greenLight
anchors.top: yellowLight.bottom
color: "green"
- visible: stateMachine.green.active
+ visible: stateMachine.green
}
}
@@ -101,14 +101,14 @@ Window {
anchors.bottom: parent.bottom
text: {
- if (stateMachine.working.active)
+ if (stateMachine.working)
"Pause"
else
"Unpause"
}
onClicked: {
- if (stateMachine.working.active)
+ if (stateMachine.working)
stateMachine.event_smash()
else
stateMachine.event_repair()