diff options
author | Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> | 2016-03-04 14:20:15 +0100 |
---|---|---|
committer | Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> | 2016-03-07 11:15:38 +0000 |
commit | f875a4546eee8d27607f33995121ff10225b3d21 (patch) | |
tree | 31cee7e800c5a6942e7590cb4dc2d75e5f193227 /examples/scxml/invoke-static | |
parent | 749d834127b99d7e69dd342ac67aff64e84f7d8f (diff) |
Doc: Add docs for Invoke examples
- Explain invoking and loading or compiling the state machine.
- Remove the unnecessary load command from invoke-static.pro.
- Add screenshots.
Change-Id: I79ae7b656bcc350c3cd96b17716a432135d9697e
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'examples/scxml/invoke-static')
-rw-r--r-- | examples/scxml/invoke-static/doc/images/invoke-static.png | bin | 0 -> 7170 bytes | |||
-rw-r--r-- | examples/scxml/invoke-static/doc/src/invoke-static.qdoc | 52 |
2 files changed, 49 insertions, 3 deletions
diff --git a/examples/scxml/invoke-static/doc/images/invoke-static.png b/examples/scxml/invoke-static/doc/images/invoke-static.png Binary files differnew file mode 100644 index 0000000..fa73ebe --- /dev/null +++ b/examples/scxml/invoke-static/doc/images/invoke-static.png 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 } */ |