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

Adding History state breaks state chart

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • 5.12.8, 5.15.1
    • State Machine: SCXML
    • None
    • All

      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)

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes