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

Adding History state breaks state chart

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 5.12.8, 5.15.1
    • XML: SCXML
    • None
    • All

    Description

      Due to wrong index resolving for isActive(stateIndex) function in qscxmlstatemachine.cpp (line 2362) state is not activated.

      History state is skipped for properties of generated state machine, so property index in isActive call is not equal to state index. Possible solution is to use signal index hash:

      bool QScxmlStateMachine::isActive(int stateIndex) const
      {
          Q_D(const QScxmlStateMachine);
      
          const int index = d->m_stateIndexToSignalIndex.key(stateIndex, -1);
      
          return d->m_configuration.contains(index);
      }
      

      simple sample is attached. Transition to B should activate it. Signals are emitted, state is added to m_configuration, but property check of generated state machine leads to wrong return (active is false)

      Attachments

        Issue Links

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

          Activity

            People

              ulherman Ulf Hermann
              e.nemtsev Egor Nemtsev
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes