summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2021-02-04 13:22:16 +0200
committerJuha Vuolle <juha.vuolle@insta.fi>2021-02-11 09:10:48 +0200
commit84c7967a6c9fc13b2e588b029030546fa6f8b92e (patch)
tree0aced5e1a961550af1461e33f5b3925c048ed584 /examples
parent72841fe10402148de78c218d06bf1a1f3d3857d0 (diff)
Qt6 related documentation changes for scxml module
Some perhaps less-obvious changes are: -Remove nonexistent imagedirs reference in qdocconf -Address some qdoc warnings (“/“ usage in an example and also std::function handling) -Fix ftpclient example filename references -Mark an escaped Q_OBJECT usage as badcode to suppress qdoc warning The Q_OBJECT itself cannot be unescaped as automoc will then fail. It shouldn't but that is the case. -Change the examples’ CMakeLists.txt to use single-line find_packages to ensure packages are not mixed and matched. Probability for problems is low but perhaps since these are examples that is appropriate Pick-to: 6.1 Task-number: QTBUG-89833 Change-Id: Ibf518aa71971e8e9d0af1b49c7de86fd28089e96 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/scxml/calculator-common/doc/src/calculator-compiling.qdocinc30
-rw-r--r--examples/scxml/calculator-qml/doc/src/calculator-qml.qdoc2
-rw-r--r--examples/scxml/calculator-widgets/CMakeLists.txt14
-rw-r--r--examples/scxml/ftpclient/CMakeLists.txt11
-rw-r--r--examples/scxml/ftpclient/doc/src/ftpclient.qdoc26
-rw-r--r--examples/scxml/invoke-dynamic/CMakeLists.txt14
-rw-r--r--examples/scxml/invoke-dynamic/doc/src/invoke-dynamic.qdoc10
-rw-r--r--examples/scxml/invoke-static/CMakeLists.txt14
-rw-r--r--examples/scxml/invoke-static/doc/src/invoke-static.qdoc26
-rw-r--r--examples/scxml/mediaplayer-common/doc/src/mediaplayer-compiling.qdocinc24
-rw-r--r--examples/scxml/mediaplayer-qml-dynamic/CMakeLists.txt14
-rw-r--r--examples/scxml/mediaplayer-qml-dynamic/doc/src/mediaplayer-qml-dynamic.qdoc13
-rw-r--r--examples/scxml/mediaplayer-widgets-dynamic/CMakeLists.txt14
-rw-r--r--examples/scxml/mediaplayer-widgets-dynamic/doc/src/mediaplayer-widgets-dynamic.qdoc13
-rw-r--r--examples/scxml/mediaplayer-widgets-static/CMakeLists.txt14
-rw-r--r--examples/scxml/trafficlight-common/doc/src/trafficlight-compiling.qdocinc25
-rw-r--r--examples/scxml/trafficlight-qml-dynamic/CMakeLists.txt13
-rw-r--r--examples/scxml/trafficlight-qml-dynamic/doc/src/trafficlight-qml-dynamic.qdoc12
-rw-r--r--examples/scxml/trafficlight-qml-static/CMakeLists.txt13
-rw-r--r--examples/scxml/trafficlight-widgets-dynamic/CMakeLists.txt13
-rw-r--r--examples/scxml/trafficlight-widgets-dynamic/doc/src/trafficlight-widgets-dynamic.qdoc12
21 files changed, 198 insertions, 129 deletions
diff --git a/examples/scxml/calculator-common/doc/src/calculator-compiling.qdocinc b/examples/scxml/calculator-common/doc/src/calculator-compiling.qdocinc
index 3e5982f..e281df7 100644
--- a/examples/scxml/calculator-common/doc/src/calculator-compiling.qdocinc
+++ b/examples/scxml/calculator-common/doc/src/calculator-compiling.qdocinc
@@ -1,16 +1,30 @@
\section1 Compiling the State Machine
- We link against the Qt SCXML module by adding the following line to the
- \e .pro file:
+ We link against the Qt SCXML module by adding the following lines to the
+ example's build files.
+
+ \section2 \e .pro when using qmake:
\quotefromfile calculator-widgets/calculator-widgets.pro
- \printuntil scxml
+ \skipto QT
+ \printline scxml
We then specify the state machine to compile:
-
\skipto STATECHARTS
- \printuntil statemachine.scxml
+ \printline scxml
+
+ \section2 \e CMakeLists.txt when using cmake:
+ \quotefromfile calculator-widgets/CMakeLists.txt
+ \skipto find_package
+ \printline Scxml
+ \skipto target_link_libraries
+ \printuntil )
+
+ We then specify the state machine to compile:
+ \skipto qt6_add_statecharts
+ \printuntil )
- The Qt SCXML Compiler, \c qscxmlc, is run automatically to generate
- \e statemachine.h and \e statemachine.cpp, and to add them to the \c HEADERS
- and \c SOURCES variables for compilation.
+ The statechart directives \e STATECHARTS or \e qt6_add_statecharts invoke the Qt SCXML
+ Compiler, \c qscxmlc, which is run automatically to generate \e statemachine.h and
+ \e statemachine.cpp, which are then added appropriately as headers and sources for
+ compilation.
diff --git a/examples/scxml/calculator-qml/doc/src/calculator-qml.qdoc b/examples/scxml/calculator-qml/doc/src/calculator-qml.qdoc
index e58fcfd..8ab7e05 100644
--- a/examples/scxml/calculator-qml/doc/src/calculator-qml.qdoc
+++ b/examples/scxml/calculator-qml/doc/src/calculator-qml.qdoc
@@ -60,7 +60,7 @@
\quotefromfile calculator-qml/calculator-qml.qml
\skipto CalculatorStateMachine
- \printline 1.0
+ \printline CalculatorStateMachine
We instantiate a CalculatorStateMachine and listen to the \c updateDisplay
event. When it occurs, we change the text on the calculator display:
diff --git a/examples/scxml/calculator-widgets/CMakeLists.txt b/examples/scxml/calculator-widgets/CMakeLists.txt
index 70d2324..2e64af4 100644
--- a/examples/scxml/calculator-widgets/CMakeLists.txt
+++ b/examples/scxml/calculator-widgets/CMakeLists.txt
@@ -15,10 +15,7 @@ endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/scxml/calculator-widgets")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS Scxml)
+find_package(Qt6 COMPONENTS Core Gui Widgets Scxml)
qt_add_executable(calculator-widgets
calculator-widgets.cpp
@@ -29,13 +26,12 @@ set_target_properties(calculator-widgets PROPERTIES
MACOSX_BUNDLE TRUE
)
target_link_libraries(calculator-widgets PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Scxml
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Scxml
+ Qt6::Widgets
)
-
# Statecharts:
qt6_add_statecharts(calculator-widgets
../calculator-common/statemachine.scxml
diff --git a/examples/scxml/ftpclient/CMakeLists.txt b/examples/scxml/ftpclient/CMakeLists.txt
index 6ddea9e..f5e1175 100644
--- a/examples/scxml/ftpclient/CMakeLists.txt
+++ b/examples/scxml/ftpclient/CMakeLists.txt
@@ -15,9 +15,7 @@ endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/scxml/ftpclient")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Scxml)
-find_package(Qt6 COMPONENTS Network)
+find_package(Qt6 COMPONENTS Core Scxml Network)
qt_add_executable(ftpclient
ftpcontrolchannel.cpp ftpcontrolchannel.h
@@ -29,12 +27,11 @@ set_target_properties(ftpclient PROPERTIES
MACOSX_BUNDLE TRUE
)
target_link_libraries(ftpclient PUBLIC
- Qt::Core
- Qt::Network
- Qt::Scxml
+ Qt6::Core
+ Qt6::Network
+ Qt6::Scxml
)
-
# Statecharts:
qt6_add_statecharts(ftpclient
simpleftp.scxml
diff --git a/examples/scxml/ftpclient/doc/src/ftpclient.qdoc b/examples/scxml/ftpclient/doc/src/ftpclient.qdoc
index b69994d..42b4437 100644
--- a/examples/scxml/ftpclient/doc/src/ftpclient.qdoc
+++ b/examples/scxml/ftpclient/doc/src/ftpclient.qdoc
@@ -67,19 +67,31 @@
\section1 Compiling the State Machine
We link against the Qt SCXML module by adding the following line to the
- \e .pro file:
+ project build files.
+ With qmake, we add the following to \e ftpclient.pro
\quotefromfile ftpclient/ftpclient.pro
- \printuntil scxml
+ \skipto QT
+ \printline scxml
We then specify the state machine to compile:
-
\skipto STATECHARTS
- \printuntil simpleftp.scxml
+ \printline scxml
+
+ With CMake, we add the following to \e CMakeLists.txt
+ \quotefromfile ftpclient/CMakeLists.txt
+ \skipto find_package
+ \printline Scxml
+ \skipto target_link_libraries
+ \printuntil )
+
+ We then specify the state machine to compile:
+ \skipto qt6_add_statecharts
+ \printuntil )
The Qt SCXML Compiler, \c qscxmlc, is run automatically to generate
- \e ftpclient.h and \e ftpclient.cpp, and to add them to the \c HEADERS
- and \c SOURCES variables for compilation.
+ \e simpleftp.h and \e simpleftp.cpp, and to add them appropriately to
+ the project as headers and sources.
\section1 Instantiating the State Machine
@@ -88,7 +100,7 @@
\quotefromfile ftpclient/main.cpp
\skipto #include
- \printuntil ftpdatachannel.h
+ \printuntil simpleftp
\dots
\skipto int main
\printuntil {
diff --git a/examples/scxml/invoke-dynamic/CMakeLists.txt b/examples/scxml/invoke-dynamic/CMakeLists.txt
index b1a7fd7..3837e40 100644
--- a/examples/scxml/invoke-dynamic/CMakeLists.txt
+++ b/examples/scxml/invoke-dynamic/CMakeLists.txt
@@ -15,10 +15,7 @@ endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/scxml/invoke-dynamic")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Qml)
-find_package(Qt6 COMPONENTS Scxml)
+find_package(Qt6 COMPONENTS Core Gui Qml Scxml)
qt_add_executable(invoke-dynamic
invoke-dynamic.cpp
@@ -28,13 +25,12 @@ set_target_properties(invoke-dynamic PROPERTIES
MACOSX_BUNDLE TRUE
)
target_link_libraries(invoke-dynamic PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Qml
- Qt::Scxml
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Qml
+ Qt6::Scxml
)
-
# Resources:
set_source_files_properties("../invoke-common/Button.qml"
PROPERTIES QT_RESOURCE_ALIAS "Button.qml"
diff --git a/examples/scxml/invoke-dynamic/doc/src/invoke-dynamic.qdoc b/examples/scxml/invoke-dynamic/doc/src/invoke-dynamic.qdoc
index bff773a..7a4a63b 100644
--- a/examples/scxml/invoke-dynamic/doc/src/invoke-dynamic.qdoc
+++ b/examples/scxml/invoke-dynamic/doc/src/invoke-dynamic.qdoc
@@ -53,12 +53,20 @@
\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:
+ project build files.
+ With qmake to the \e invoke-dynamic.pro
\quotefromfile invoke-dynamic/invoke-dynamic.pro
\skipto QT
\printline scxml
+ With cmake to the \e CMakeLists.txt
+ \quotefromfile invoke-dynamic/CMakeLists.txt
+ \skipto find_package
+ \printline Scxml
+ \skipto target_link_libraries
+ \printuntil )
+
We dynamically create the state machine, as follows:
\quotefromfile invoke-dynamic/invoke-dynamic.qml
diff --git a/examples/scxml/invoke-static/CMakeLists.txt b/examples/scxml/invoke-static/CMakeLists.txt
index 93cbda9..640da50 100644
--- a/examples/scxml/invoke-static/CMakeLists.txt
+++ b/examples/scxml/invoke-static/CMakeLists.txt
@@ -15,10 +15,7 @@ endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/scxml/invoke-static")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Qml)
-find_package(Qt6 COMPONENTS Scxml)
+find_package(Qt6 COMPONENTS Core Gui Qml Scxml)
qt_add_executable(invoke-static
invoke-static.cpp
@@ -28,13 +25,12 @@ set_target_properties(invoke-static PROPERTIES
MACOSX_BUNDLE TRUE
)
target_link_libraries(invoke-static PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Qml
- Qt::Scxml
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Qml
+ Qt6::Scxml
)
-
# Resources:
set_source_files_properties("../invoke-common/Button.qml"
PROPERTIES QT_RESOURCE_ALIAS "Button.qml"
diff --git a/examples/scxml/invoke-static/doc/src/invoke-static.qdoc b/examples/scxml/invoke-static/doc/src/invoke-static.qdoc
index 099b904..7a3a8a2 100644
--- a/examples/scxml/invoke-static/doc/src/invoke-static.qdoc
+++ b/examples/scxml/invoke-static/doc/src/invoke-static.qdoc
@@ -51,22 +51,34 @@
\printuntil
\section1 Compiling the State Machine
+ We link against the Qt SCXML module by adding the following lines to the
+ example's build files.
- We link against the Qt SCXML module by adding the following line to the
- \e invoke-static.pro file:
+ \section2 \e invoke-static.pro when using qmake:
\quotefromfile invoke-static/invoke-static.pro
\skipto QT
\printline scxml
We then specify the state machine to compile:
-
\skipto STATECHARTS
- \printline statemachine
+ \printline scxml
+
+ \section2 \e CMakeLists.txt when using cmake:
+ \quotefromfile invoke-static/CMakeLists.txt
+ \skipto find_package
+ \printline Scxml
+ \skipto target_link_libraries
+ \printuntil )
+
+ We then specify the state machine to compile:
+ \skipto qt6_add_statecharts
+ \printuntil )
- The Qt SCXML Compiler, \c qscxmlc, is run automatically to generate
- \e statemachine.h and \e statemachine.cpp, and to add them to the \c HEADERS
- and \c SOURCES variables for compilation.
+ The statechart directives \e STATECHARTS or \e qt6_add_statecharts invoke the Qt SCXML
+ Compiler, \c qscxmlc, which is run automatically to generate \e statemachine.h and
+ \e statemachine.cpp, which are then added appropriately as headers and sources for
+ compilation.
\section1 Instantiating the State Machine
diff --git a/examples/scxml/mediaplayer-common/doc/src/mediaplayer-compiling.qdocinc b/examples/scxml/mediaplayer-common/doc/src/mediaplayer-compiling.qdocinc
index 711a32f..8e8cfbe 100644
--- a/examples/scxml/mediaplayer-common/doc/src/mediaplayer-compiling.qdocinc
+++ b/examples/scxml/mediaplayer-common/doc/src/mediaplayer-compiling.qdocinc
@@ -1,17 +1,29 @@
\section1 Compiling the State Machine
- We link against the Qt SCXML module by adding the following line to the
- \e .pro file:
+ We link against the Qt SCXML module by adding the following lines to the
+ example's build files.
+
+ \section2 \e .pro when using qmake:
\quotefromfile mediaplayer-widgets-static/mediaplayer-widgets-static.pro
\skipto QT
\printline scxml
We then specify the state machine to compile:
-
\skipto STATECHARTS
\printline scxml
- The Qt SCXML Compiler, \c qscxmlc, is run automatically to generate
- \e statemachine.h and \e statemachine.cpp, and to add them to the \c HEADERS
- and \c SOURCES variables for compilation.
+ \section2 \e CMakeLists.txt when using cmake:
+ \quotefromfile mediaplayer-widgets-static/CMakeLists.txt
+ \skipto find_package
+ \printline Scxml
+ \skipto target_link_libraries
+ \printuntil )
+
+ We then specify the state machine to compile:
+ \skipto qt6_add_statecharts
+ \printuntil )
+
+ The statechart directives \e STATECHARTS or \e qt6_add_statecharts invoke the Qt SCXML
+ Compiler, \c qscxmlc, which is run automatically to generate a header and a source file,
+ which are then added appropriately for compilation.
diff --git a/examples/scxml/mediaplayer-qml-dynamic/CMakeLists.txt b/examples/scxml/mediaplayer-qml-dynamic/CMakeLists.txt
index 910e20d..38f7f92 100644
--- a/examples/scxml/mediaplayer-qml-dynamic/CMakeLists.txt
+++ b/examples/scxml/mediaplayer-qml-dynamic/CMakeLists.txt
@@ -15,10 +15,7 @@ endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/scxml/mediaplayer-qml-dynamic")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Qml)
-find_package(Qt6 COMPONENTS Scxml)
+find_package(Qt6 COMPONENTS Core Gui Qml Scxml)
qt_add_executable(mediaplayer-qml-dynamic
mediaplayer-qml-dynamic.cpp
@@ -28,13 +25,12 @@ set_target_properties(mediaplayer-qml-dynamic PROPERTIES
MACOSX_BUNDLE TRUE
)
target_link_libraries(mediaplayer-qml-dynamic PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Qml
- Qt::Scxml
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Qml
+ Qt6::Scxml
)
-
# Resources:
set_source_files_properties("../mediaplayer-common/Mediaplayer.qml"
PROPERTIES QT_RESOURCE_ALIAS "Mediaplayer.qml"
diff --git a/examples/scxml/mediaplayer-qml-dynamic/doc/src/mediaplayer-qml-dynamic.qdoc b/examples/scxml/mediaplayer-qml-dynamic/doc/src/mediaplayer-qml-dynamic.qdoc
index 22d3ea2..e981290 100644
--- a/examples/scxml/mediaplayer-qml-dynamic/doc/src/mediaplayer-qml-dynamic.qdoc
+++ b/examples/scxml/mediaplayer-qml-dynamic/doc/src/mediaplayer-qml-dynamic.qdoc
@@ -47,14 +47,23 @@
\section1 Dynamically Loading the State Machine
We link against the Qt SCXML module by adding the following line to the
- example \e .pro file:
+ project build files.
+
+ With qmake to the \e mediaplayer-qml-dynamic.pro
\quotefromfile mediaplayer-qml-dynamic/mediaplayer-qml-dynamic.pro
\skipto QT
\printline scxml
+ With cmake to the \e CMakeLists.txt
+ \quotefromfile mediaplayer-qml-dynamic/CMakeLists.txt
+ \skipto find_package
+ \printline Scxml
+ \skipto target_link_libraries
+ \printuntil )
+
We dynamically create the state machine in
- \e mediaplayer-common\Mediaplayer.qml:
+ \e {mediaplayer-common\\Mediaplayer.qml:}
\quotefromfile mediaplayer-common/Mediaplayer.qml
\skipto import QtScxml
diff --git a/examples/scxml/mediaplayer-widgets-dynamic/CMakeLists.txt b/examples/scxml/mediaplayer-widgets-dynamic/CMakeLists.txt
index 775142a..128549b 100644
--- a/examples/scxml/mediaplayer-widgets-dynamic/CMakeLists.txt
+++ b/examples/scxml/mediaplayer-widgets-dynamic/CMakeLists.txt
@@ -15,10 +15,7 @@ endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/scxml/mediaplayer-widgets-dynamic")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS Scxml)
+find_package(Qt6 COMPONENTS Core Gui Widgets Scxml)
qt_add_executable(mediaplayer-widgets-dynamic
../mediaplayer-common/mainwindow.cpp ../mediaplayer-common/mainwindow.h ../mediaplayer-common/mainwindow.ui
@@ -29,13 +26,12 @@ set_target_properties(mediaplayer-widgets-dynamic PROPERTIES
MACOSX_BUNDLE TRUE
)
target_link_libraries(mediaplayer-widgets-dynamic PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Scxml
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Scxml
+ Qt6::Widgets
)
-
# Resources:
set_source_files_properties("../mediaplayer-common/mediaplayer.scxml"
PROPERTIES QT_RESOURCE_ALIAS "mediaplayer.scxml"
diff --git a/examples/scxml/mediaplayer-widgets-dynamic/doc/src/mediaplayer-widgets-dynamic.qdoc b/examples/scxml/mediaplayer-widgets-dynamic/doc/src/mediaplayer-widgets-dynamic.qdoc
index 59ec84f..51d4b95 100644
--- a/examples/scxml/mediaplayer-widgets-dynamic/doc/src/mediaplayer-widgets-dynamic.qdoc
+++ b/examples/scxml/mediaplayer-widgets-dynamic/doc/src/mediaplayer-widgets-dynamic.qdoc
@@ -47,11 +47,20 @@
\section1 Dynamically Loading the State Machine
We link against the Qt SCXML module by adding the following line to the
- example \e .pro file:
+ project build files.
+
+ With qmake to the \e mediaplayer-widgets-dynamic.pro
\quotefromfile mediaplayer-widgets-dynamic/mediaplayer-widgets-dynamic.pro
\skipto QT
- \printuntil scxml
+ \printline scxml
+
+ With cmake to the \e CMakeLists.txt
+ \quotefromfile mediaplayer-widgets-dynamic/CMakeLists.txt
+ \skipto find_package
+ \printline Scxml
+ \skipto target_link_libraries
+ \printuntil )
\quotefromfile mediaplayer-widgets-dynamic/mediaplayer-widgets-dynamic.cpp
diff --git a/examples/scxml/mediaplayer-widgets-static/CMakeLists.txt b/examples/scxml/mediaplayer-widgets-static/CMakeLists.txt
index e143592..3a95fc0 100644
--- a/examples/scxml/mediaplayer-widgets-static/CMakeLists.txt
+++ b/examples/scxml/mediaplayer-widgets-static/CMakeLists.txt
@@ -15,10 +15,7 @@ endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/scxml/mediaplayer-widgets-static")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS Scxml)
+find_package(Qt6 COMPONENTS Core Gui Widgets Scxml)
qt_add_executable(mediaplayer-widgets-static
../mediaplayer-common/mainwindow.cpp ../mediaplayer-common/mainwindow.h ../mediaplayer-common/mainwindow.ui
@@ -29,13 +26,12 @@ set_target_properties(mediaplayer-widgets-static PROPERTIES
MACOSX_BUNDLE TRUE
)
target_link_libraries(mediaplayer-widgets-static PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Scxml
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Scxml
+ Qt6::Widgets
)
-
# Statecharts:
qt6_add_statecharts(mediaplayer-widgets-static
../mediaplayer-common/mediaplayer.scxml
diff --git a/examples/scxml/trafficlight-common/doc/src/trafficlight-compiling.qdocinc b/examples/scxml/trafficlight-common/doc/src/trafficlight-compiling.qdocinc
index ac16203..1410dcb 100644
--- a/examples/scxml/trafficlight-common/doc/src/trafficlight-compiling.qdocinc
+++ b/examples/scxml/trafficlight-common/doc/src/trafficlight-compiling.qdocinc
@@ -1,17 +1,30 @@
\section1 Compiling the State Machine
- We link against the Qt SCXML module by adding the following line to the
- \e .pro file:
+ We link against the Qt SCXML module by adding the following lines to the
+ example's build files.
+
+ \section2 \e .pro when using qmake:
\quotefromfile trafficlight-qml-static/trafficlight-qml-static.pro
\skipto QT
\printline scxml
We then specify the state machine to compile:
-
\skipto STATECHARTS
\printline scxml
- The Qt SCXML Compiler, \c qscxmlc, is run automatically to generate
- \e statemachine.h and \e statemachine.cpp, and to add them to the \c HEADERS
- and \c SOURCES variables for compilation.
+ \section2 \e CMakeLists.txt when using cmake:
+ \quotefromfile trafficlight-qml-static/CMakeLists.txt
+ \skipto find_package
+ \printline Scxml
+ \skipto target_link_libraries
+ \printuntil )
+
+ We then specify the state machine to compile:
+ \skipto qt6_add_statecharts
+ \printuntil )
+
+ The statechart directives \e STATECHARTS or \e qt6_add_statecharts invoke the Qt SCXML
+ Compiler, \c qscxmlc, which is run automatically to generate \e statemachine.h and
+ \e statemachine.cpp, which are then added appropriately as headers and sources for
+ compilation.
diff --git a/examples/scxml/trafficlight-qml-dynamic/CMakeLists.txt b/examples/scxml/trafficlight-qml-dynamic/CMakeLists.txt
index 20ab198..fd4a5a6 100644
--- a/examples/scxml/trafficlight-qml-dynamic/CMakeLists.txt
+++ b/examples/scxml/trafficlight-qml-dynamic/CMakeLists.txt
@@ -15,10 +15,7 @@ endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/scxml/trafficlight-qml-dynamic")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Qml)
-find_package(Qt6 COMPONENTS Scxml)
+find_package(Qt6 COMPONENTS Core Gui Qml Scxml)
qt_add_executable(trafficlight-qml-dynamic
trafficlight-qml-dynamic.cpp
@@ -28,10 +25,10 @@ set_target_properties(trafficlight-qml-dynamic PROPERTIES
MACOSX_BUNDLE TRUE
)
target_link_libraries(trafficlight-qml-dynamic PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Qml
- Qt::Scxml
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Qml
+ Qt6::Scxml
)
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 0316508..56e4dc4 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
@@ -44,13 +44,21 @@
\section1 Dynamically Loading the State Machine
- We link against the Qt SCXML module by adding the following line to the
- example \e .pro file:
+ We link against the Qt SCXML module by adding the following lines to the
+ example's build files.
+ To \e .pro when using qmake:
\quotefromfile trafficlight-qml-dynamic/trafficlight-qml-dynamic.pro
\skipto QT
\printline scxml
+ To \e CMakeLists.txt when using cmake:
+ \quotefromfile trafficlight-qml-dynamic/CMakeLists.txt
+ \skipto find_package
+ \printline Scxml
+ \skipto target_link_libraries
+ \printuntil )
+
We dynamically create the state machine in the main QML file:
\quotefromfile trafficlight-qml-dynamic/trafficlight-qml-dynamic.qml
diff --git a/examples/scxml/trafficlight-qml-static/CMakeLists.txt b/examples/scxml/trafficlight-qml-static/CMakeLists.txt
index a61e14e..9747461 100644
--- a/examples/scxml/trafficlight-qml-static/CMakeLists.txt
+++ b/examples/scxml/trafficlight-qml-static/CMakeLists.txt
@@ -15,10 +15,7 @@ endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/scxml/trafficlight-qml-static")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Qml)
-find_package(Qt6 COMPONENTS Scxml)
+find_package(Qt6 COMPONENTS Core Gui Qml Scxml)
qt_add_executable(trafficlight-qml-static
trafficlight-qml-static.cpp
@@ -28,10 +25,10 @@ set_target_properties(trafficlight-qml-static PROPERTIES
MACOSX_BUNDLE TRUE
)
target_link_libraries(trafficlight-qml-static PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Qml
- Qt::Scxml
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Qml
+ Qt6::Scxml
)
diff --git a/examples/scxml/trafficlight-widgets-dynamic/CMakeLists.txt b/examples/scxml/trafficlight-widgets-dynamic/CMakeLists.txt
index 1cdd7e6..c860c0d 100644
--- a/examples/scxml/trafficlight-widgets-dynamic/CMakeLists.txt
+++ b/examples/scxml/trafficlight-widgets-dynamic/CMakeLists.txt
@@ -15,10 +15,7 @@ endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/scxml/trafficlight-widgets-dynamic")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS Scxml)
+find_package(Qt6 COMPONENTS Core Gui Widgets Scxml)
qt_add_executable(trafficlight-widgets-dynamic
../trafficlight-common/trafficlight.cpp ../trafficlight-common/trafficlight.h
@@ -29,10 +26,10 @@ set_target_properties(trafficlight-widgets-dynamic PROPERTIES
MACOSX_BUNDLE TRUE
)
target_link_libraries(trafficlight-widgets-dynamic PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Scxml
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Scxml
+ Qt6::Widgets
)
diff --git a/examples/scxml/trafficlight-widgets-dynamic/doc/src/trafficlight-widgets-dynamic.qdoc b/examples/scxml/trafficlight-widgets-dynamic/doc/src/trafficlight-widgets-dynamic.qdoc
index de37ae0..ecf7d91 100644
--- a/examples/scxml/trafficlight-widgets-dynamic/doc/src/trafficlight-widgets-dynamic.qdoc
+++ b/examples/scxml/trafficlight-widgets-dynamic/doc/src/trafficlight-widgets-dynamic.qdoc
@@ -44,13 +44,21 @@
\section1 Dynamically Loading the State Machine
- We link against the Qt SCXML module by adding the following line to the
- example \e .pro file:
+ We link against the Qt SCXML module by adding the following lines to the
+ example's build files.
+ To \e .pro when using qmake:
\quotefromfile trafficlight-widgets-dynamic/trafficlight-widgets-dynamic.pro
\skipto QT
\printline scxml
+ To \e CMakeLists.txt when using cmake:
+ \quotefromfile trafficlight-widgets-dynamic/CMakeLists.txt
+ \skipto find_package
+ \printline Scxml
+ \skipto target_link_libraries
+ \printuntil )
+
We dynamically create the state machine in
\e trafficlight-widgets-dynamic.cpp: