-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.11, 6.2.6, 6.4.1
-
Windows 10 Pro 22H2, MSVC 2019 x64
https://doc.qt.io/qt-6/qscxmlstatemachine.html#start says, "The machine will reset its configuration and transition to the initial state." However, it looks like the old/stale state is retained.
Steps to reproduce

- Build and run the attached project
- Click "Start"
- Keep clicking "Next" until the machine reports that it is "Finished"
- Click "Stop"
- Click "Start" again
(Note: Step #4 has no effect and can be omitted from the test above. It was included for completeness.)
Outcomes: Up till Step #3
So far so good:
Starting... Running?: true Entering "State1" -- Active states: "State1" Exiting "State1" -- Active states: "" Entering "State2" -- Active states: "State2" Exiting "State2" -- Active states: "" Entering "State3" -- Active states: "State3" Exiting "State3" -- Active states: "" Running?: false Entering "Final" -- Active states: "Final" Finished
Actual outcome: Step #5
Starting... Running?: true Entering "State1" -- Active states: "Final|State1"
Expected outcome: Step #5
Starting... Running?: true Entering "State1" -- Active states: "State1"
| For Gerrit Dashboard: QTBUG-109371 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 448604,2 | WIP Clear active states and events when state machine is restarted | dev | qt/qtscxml | Status: ABANDONED | -2 | 0 |
| 553554,1 | Fix documentation for StateMachine start() | dev | qt/qtscxml | Status: ABANDONED | 0 | 0 |
| 555061,5 | Add a note about QScxmlStateMachine restart | dev | qt/qtscxml | Status: MERGED | +2 | 0 |
| 555360,12 | QScxmlStateMachine add runtime warning | dev | qt/qtscxml | Status: MERGED | +2 | 0 |