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

EventConnection should adopt Connections API

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Some future release
    • XML: SCXML
    • None
    • All

    Description

      EventConnection has a very un-QML like API. You first have to specify a list of strings with the names of events you want to have, and then you need to react to a single signal where you end up making an if/else cascade to react to these events, again testing for event names by strings. Any arguments end up in That's rather messy and un-QML like.

      Connections now has an API where you just declare the functions to react to the signals you need. That approach would work well with SCXML as well I think: simply define the handler functions on<EventName> for the events you want to react to. No need to explicitly specify them in the events property, and no possibility to have a typo in the onOccurred handler if/else cascade as the names of the functions can be checked against the events existing in the state machine.

      I would also suggest to unpack the arguments from the QVariantMap into separate arguments for these functions to have the API really be symmetrical with Connections.

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            andre André Somers
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes