diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-10-06 12:32:40 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2022-10-17 06:30:24 +0000 |
commit | a7e44fcdcc463f2698c5c896fa64f66b72837151 (patch) | |
tree | 84f5255f34ba4de49834dda8d3033eeb530047ca | |
parent | 03b955af366abc367400e01c1aa6d77a2c2253b0 (diff) |
Doc: Update documentation on how to integrate with QML
You should not use qmlRegisterType()
Fixes: QTBUG-107209
Pick-to: 6.4 6.2
Change-Id: I98c3c84d3e6d1334eedef98a55ead7c2adef89e1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r-- | src/scxml/doc/qtscxml-instantiating-state-machines.qdoc | 7 |
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: |