summaryrefslogtreecommitdiffstats
path: root/examples/scxml/trafficlight-qml-dynamic
diff options
context:
space:
mode:
authorLeena Miettinen <riitta-leena.miettinen@theqtcompany.com>2016-03-17 09:36:38 +0100
committerLeena Miettinen <riitta-leena.miettinen@theqtcompany.com>2016-03-17 09:13:46 +0000
commit8463c9540f3ea842b6c653e9afea46d1a4da67b0 (patch)
tree35ebec160b69de1323c0b16ef4118fe0a9dace21 /examples/scxml/trafficlight-qml-dynamic
parent78b4524e71c1cd7f6f661222479b81901f98aa7a (diff)
Doc: Add docs for the Traffic Light example
Change-Id: Id51e2cb7eaf04179efe5379ac82f596ede3f6b04 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'examples/scxml/trafficlight-qml-dynamic')
-rw-r--r--examples/scxml/trafficlight-qml-dynamic/doc/src/trafficlight-qml-dynamic.qdoc38
1 files changed, 36 insertions, 2 deletions
diff --git a/examples/scxml/trafficlight-qml-dynamic/doc/src/trafficlight-qml-dynamic.qdoc b/examples/scxml/trafficlight-qml-dynamic/doc/src/trafficlight-qml-dynamic.qdoc
index c2c4dc7..67ec5c8 100644
--- a/examples/scxml/trafficlight-qml-dynamic/doc/src/trafficlight-qml-dynamic.qdoc
+++ b/examples/scxml/trafficlight-qml-dynamic/doc/src/trafficlight-qml-dynamic.qdoc
@@ -27,8 +27,42 @@
/*!
\example trafficlight-qml-dynamic
- \title Qt SCXML: Traffic Light QML Example (Dynamic)
+ \title Qt SCXML Traffic Light QML Example (Dynamic)
\ingroup examples-qtscxml
- \brief Demonstrates using a state-machine for a simple traffic light.
+ \brief A Qt Quick application that uses a dynamically loaded state machine
+ to implement a traffic light.
+
+ \image trafficlight.png
+
+ \e{Traffic Light QML Example (Dynamic)} demonstrates how to connect to the
+ active properties of a state in a dynamically loaded state machine.
+
+ The UI is created using Qt Quick.
+
+ \include examples-run.qdocinc
+
+ \section1 Dynamically Loading the State Machine
+
+ We link against the Qt SCXML module by adding the following line to the
+ example \e .pro file:
+
+ \quotefromfile trafficlight-qml-dynamic/trafficlight-qml-dynamic.pro
+ \skipto QT
+ \printline scxml
+
+ We dynamically create the state machine in the main QML file:
+
+ \quotefromfile trafficlight-qml-dynamic/trafficlight-qml-dynamic.qml
+ \skipto import Scxml
+ \printuntil }
+
+ \include trafficlight-state-machine.qdocinc
+
+ We connect to the states as follows:
+
+ \quotefromfile trafficlight-common/TrafficLight.qml
+ \skipto Light
+ \printuntil greenLight
+ \printuntil /^ {4}\}/
*/