summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-10-06 12:32:40 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-10-17 07:03:46 +0000
commitea8b1cd246f2e994f92aee82bab98e7dc029aed1 (patch)
treef954c77e2d9460ecaad452a9f4e224a0b45dc02e
parente5682e470deb5dbd61174887ce624e0a1a3e51b7 (diff)
Doc: Update documentation on how to integrate with QML
You should not use qmlRegisterType() Fixes: QTBUG-107209 Change-Id: I98c3c84d3e6d1334eedef98a55ead7c2adef89e1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit a7e44fcdcc463f2698c5c896fa64f66b72837151) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/scxml/doc/qtscxml-instantiating-state-machines.qdoc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/scxml/doc/qtscxml-instantiating-state-machines.qdoc b/src/scxml/doc/qtscxml-instantiating-state-machines.qdoc
index 302ecfb..c78ef2b 100644
--- a/src/scxml/doc/qtscxml-instantiating-state-machines.qdoc
+++ b/src/scxml/doc/qtscxml-instantiating-state-machines.qdoc
@@ -47,7 +47,12 @@
To use a compiled state machine in QML, you can register it as a QML type:
\code
- qmlRegisterType<MyStateMachine>("MyStateMachine", 1, 0, "MyStateMachine");
+ struct MyStateMachineRegistration {
+ Q_GADGET
+ QML_NAMED_ELEMENT(MyStateMachine)
+ QML_FOREIGN(MyStateMachine)
+ QML_ADDED_IN_VERSION(1, 0)
+ };
\endcode
Then you can instantiate it in QML, like this: