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

Allow processing of unconsumed external events

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.7.0
    • Fix Version/s: None
    • Component/s: Core: State Machine
    • Labels:
      None

      Description

      A state machine based component should be able to catch external events or signals which trigger no transitions (i.e. no micro steps, empty macro step).

      For example, a signal-based command interface might demand a negative acknowledgement, if the state machine is not in the expected configuration.

      One way would be to add target-less transitions to the top state, so they can trigger the negative acknowledgement as a fallback. But if parallel children are present (orthogonal regions in XML jargon), all of them inherit the target-less transition and it doesn't work like this anymore.

      Using a combination of existing internal and private interfaces is also ruled out for obvious reasons:
      void QStateMachine::beginSelectTransitions(QEvent *event)
      void QStateMachinePrivate::processedPendingEvents(bool didChange)

      I suggest an appropriate method which can be adapted in a subclass, e.g.:
      QStateMachine::processUnconsumedEvent( QEvent *event )

      See also:
      http://www.boost.org/doc/libs/1_46_1/libs/statechart/doc/reference.html#unconsumed_event
      http://stackoverflow.com/questions/8327906/catching-discarded-events-in-boost-statechart-library

        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:
            tscheck Torsten Scheck
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes