From f875a4546eee8d27607f33995121ff10225b3d21 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 4 Mar 2016 14:20:15 +0100 Subject: 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 --- .../invoke-static/doc/images/invoke-static.png | Bin 0 -> 7170 bytes .../scxml/invoke-static/doc/src/invoke-static.qdoc | 52 +++++++++++++++++++-- 2 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 examples/scxml/invoke-static/doc/images/invoke-static.png (limited to 'examples/scxml/invoke-static') 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 Binary files /dev/null and b/examples/scxml/invoke-static/doc/images/invoke-static.png 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 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 element + with generated nested state-machines, where the SCXML file is compiled to + a C++ class. The \c 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 } */ -- cgit v1.2.3