- 
    
Bug
 - 
    Resolution: Done
 - 
    
P2: Important
 - 
    6.2.7, 6.2, 6.4.1, 6.4, 6.5.0 Beta1
 - 
    6.2.6, 6.4.0
 
- 
        a7e44fcdcc (qt/qtscxml/dev) ea8b1cd246 (qt/qtscxml/6.4) ea8b1cd246 (qt/tqtc-qtscxml/6.4) a7e44fcdcc (qt/tqtc-qtscxml/dev) ebcc383385 (qt/tqtc-qtscxml/6.2) ea8b1cd246 (qt/qtscxml/6.4.1) ea8b1cd246 (qt/tqtc-qtscxml/6.4.1)
 
qt_add_statecharts() automatically runs qscxmlc to generate the state machine class in C++.
However, if the state machine is to be used in QML, it currently needs to be registered at runtime (e.g. qmlRegisterType<MyStateMachine>("MyStateMachine", 1, 0, "MyStateMachine"); ) as documented at https://doc.qt.io/qt-6/qtscxml-instantiating-state-machines.html . Consequently, the state machine is invisible to the Qt Quick Compiler – qmlsc says,
Warning: Failed to import MyStateMachine. Are your include paths set up properly?