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

Add guard predicate to QSignalTransition

XMLWordPrintable

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

      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
      );

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

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

              Created:
              Updated:

                There are no open Gerrit changes