summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/scxml/invoke-dynamic/doc/images/invoke-dynamic.pngbin0 -> 6580 bytes
-rw-r--r--examples/scxml/invoke-dynamic/doc/src/invoke-dynamic.qdoc38
-rw-r--r--examples/scxml/invoke-dynamic/invoke-dynamic.pro2
-rw-r--r--examples/scxml/invoke-static/doc/images/invoke-static.pngbin0 -> 7170 bytes
-rw-r--r--examples/scxml/invoke-static/doc/src/invoke-static.qdoc52
5 files changed, 84 insertions, 8 deletions
diff --git a/examples/scxml/invoke-dynamic/doc/images/invoke-dynamic.png b/examples/scxml/invoke-dynamic/doc/images/invoke-dynamic.png
new file mode 100644
index 0000000..4efa912
--- /dev/null
+++ b/examples/scxml/invoke-dynamic/doc/images/invoke-dynamic.png
Binary files differ
diff --git a/examples/scxml/invoke-dynamic/doc/src/invoke-dynamic.qdoc b/examples/scxml/invoke-dynamic/doc/src/invoke-dynamic.qdoc
index aff0d9d..8c0f570 100644
--- a/examples/scxml/invoke-dynamic/doc/src/invoke-dynamic.qdoc
+++ b/examples/scxml/invoke-dynamic/doc/src/invoke-dynamic.qdoc
@@ -27,9 +27,41 @@
/*!
\example invoke-dynamic
- \title Qt SCXML: Invoke Example (Dynamic)
+ \title Qt SCXML Invoke Example (Dynamic)
\ingroup examples-qtscxml
- \brief Demonstrates the use of <invoke> and the use of the generated/created
- nested state-machines, where the SCXML file dynamically loaded.
+ \brief Invokes a dynamically loaded nested state machine.
+
+ \image invoke-dynamic.png
+
+ \e{Invoke Example (Dynamic)} demonstrates how to use the \c <invoke> element
+ with generated nested state-machines, where the SCXML file is dynamically
+ loaded. The \c <invoke> element is used to create an instance of an external
+ service.
+
+ \include examples-run.qdocinc
+
+ \section1 Invoking the State Machine
+
+ In \e statemachine.scxml, we specify a state machine with the name
+ \e Directions of type \e http://www.w3.org/TR/scxml/ to invoke:
+
+ \quotefromfile invoke-common/statemachine.scxml
+ \skipto enable-qt-mode
+ \printuntil
+
+ \section1 Dynamically Loading the State Machine
+
+ We link against the Qt SCXML module by adding the following line to the
+ \e invoke-dynamic.pro file:
+
+ \quotefromfile invoke-dynamic/invoke-dynamic.pro
+ \skipto QT
+ \printline scxml
+
+ We dynamically create the state machine, as follows:
+
+ \quotefromfile invoke-dynamic/invoke-dynamic.qml
+ \skipto import
+ \printuntil }
*/
diff --git a/examples/scxml/invoke-dynamic/invoke-dynamic.pro b/examples/scxml/invoke-dynamic/invoke-dynamic.pro
index d86caeb..e4f07da 100644
--- a/examples/scxml/invoke-dynamic/invoke-dynamic.pro
+++ b/examples/scxml/invoke-dynamic/invoke-dynamic.pro
@@ -7,8 +7,6 @@ SOURCES += invoke-dynamic.cpp
RESOURCES += invoke-dynamic.qrc
-load(qscxmlc)
-
target.path = $$[QT_INSTALL_EXAMPLES]/scxml/invoke-dynamic
INSTALLS += target
diff --git a/examples/scxml/invoke-static/doc/images/invoke-static.png b/examples/scxml/invoke-static/doc/images/invoke-static.png
new file mode 100644
index 0000000..fa73ebe
--- /dev/null
+++ b/examples/scxml/invoke-static/doc/images/invoke-static.png
Binary files differ
diff --git a/examples/scxml/invoke-static/doc/src/invoke-static.qdoc b/examples/scxml/invoke-static/doc/src/invoke-static.qdoc
index a7987e3..d2ecc78 100644
--- a/examples/scxml/invoke-static/doc/src/invoke-static.qdoc
+++ b/examples/scxml/invoke-static/doc/src/invoke-static.qdoc
@@ -27,9 +27,55 @@
/*!
\example invoke-static
- \title Qt SCXML: Invoke Example (Static)
+ \title Qt SCXML Invoke Example (Static)
\ingroup examples-qtscxml
- \brief Demonstrates the use of <invoke> and the use of the generated/created
- nested state-machines, where the SCXML file is compiled to C++ first.
+ \brief Invokes a compiled nested state machine.
+
+ \image invoke-static.png
+
+ \e{Invoke Example (Static)} demonstrates how to use the \c <invoke> element
+ with generated nested state-machines, where the SCXML file is compiled to
+ a C++ class. The \c <invoke> element is used to create an instance of an
+ external service.
+
+ \include examples-run.qdocinc
+
+ \section1 Invoking the State Machine
+
+ In \e statemachine.scxml, we specify a state machine with the name
+ \e Directions of type \e http://www.w3.org/TR/scxml/ to invoke:
+
+ \quotefromfile invoke-common/statemachine.scxml
+ \skipto enable-qt-mode
+ \printuntil
+
+ \section1 Compiling the State Machine
+
+ We link against the Qt SCXML module by adding the following line to the
+ \e invoke-static.pro file:
+
+ \quotefromfile invoke-static/invoke-static.pro
+ \skipto QT
+ \printline scxml
+
+ We then specify the state machine to compile:
+
+ \skipto STATECHARTS
+ \printline statemachine
+
+ We also tell qmake to run \c qscxmlc, which generates \e statemachine.h and
+ \e statemachine.cpp, and adds them to the \c HEADERS and \c SOURCES
+ variables for compilation:
+
+ \printuntil qscxmlc
+
+ \section1 Instantiating the State Machine
+
+ We instantiate the generated \c Directions class in the \e invoke-static.cpp
+ file, as follows:
+
+ \quotefromfile invoke-static/invoke-static.cpp
+ \skipto statemachine.h
+ \printuntil }
*/