Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-109371

Restarting a stopped QScxmlStateMachine machine creates an invalid state

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.11, 6.2.6, 6.4.1, 6.5.5, 6.6.3, 6.7.0
    • XML: SCXML
    • Windows 10 Pro 22H2, MSVC 2019 x64

    Description

      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

      1. Build and run the attached project
      2. Click "Start"
      3. Keep clicking "Next" until the machine reports that it is "Finished"
      4. Click "Stop"
      5. 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"
      

      Attachments

        1. linear-state-machine-1.png
          linear-state-machine-1.png
          6 kB
        2. qtbug109371.zip
          2 kB
        3. qtbug-109371.zip
          2 kB
        For Gerrit Dashboard: QTBUG-109371
        # Subject Branch Project Status CR V

        Activity

          People

            dima.a Dmitrii Akshintsev
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are 2 open Gerrit changes