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

Child states added while running are not reachable

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.9.0, 5.15.2
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      Windows

      Description

      The documentation of QStateMachine indicates that removing states while running is discouraged, but does not mention adding states while running. This behaves oddly (see attached test)

      • OK: Add a sibling state before starting
        • PASS : QStateMachineInitialStateIssue::existingStateOk()
      • OK: Add a sibling state while running
        • PASS : QStateMachineInitialStateIssue::addSiblingStateWhileRunningOk()
      • OK: Add an initial child state before starting
        • PASS : QStateMachineInitialStateIssue::existingChildOk()
      • NOK: Add an initial child state while running
        • FAIL! : QStateMachineInitialStateIssue::addChildWhileRunningFail() 'childStateEntered.wait()' returned FALSE. ()

      It appears the state machine isn't aware of new children added while running and cannot transition to the newly added children. Also, one could argue it should transition to the new initial child when setting the new child state as the initial one.

      Restarting the entire state machine is a workaround: once restarted, the child state will be activated because it's the initial one. But: this looses the entire state, which is undesirable in my application.

      Please advise on how to handle this scenario. 

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            ulherman Ulf Hermann
            Reporter:
            koen.poppe koen.poppe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes