Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
Some future release
-
None
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.