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

Add guard predicate to QSignalTransition

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • Core: State Machine
    • None
    • All

    Description

      Currently the QSignalTransition needs to be subclassed and QSignalTransition::eventTest() to be overridden in order to have a conditional transition.

      This could be made easier by adding guard predicate (similar as in the QML SignalTransition.guard) to the QSignalTransition. The transition will be triggered if the guard predicate returns true.

      E.g by using lambda.

      QSignalTransition(
         sender,
         &QObject::destroyed,
         [sender] { return (sender->objectName() == "foobar"); },
         nextState
      );

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            kais Kai Solehmainen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes