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

Restarting a stopped QScxmlStateMachine machine creates an invalid state

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.8.0 FF
    • 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
    • 2c966b97b (dev), 9c8577c12 (dev)

    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. qtbug-109371.zip
          2 kB
        2. qtbug109371.zip
          2 kB
        3. linear-state-machine-1.png
          linear-state-machine-1.png
          6 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes