Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to receive and react to statemachine targetless transitions ?
YenZi last edited by
in the Qt documentation of the State machine it says :
A transition need not have a target state. A transition without a target can be triggered the same way as any other transition; the difference is that it doesn't cause any state changes. This allows you to react to a signal or event when your machine is in a certain state, without having to leave that state.
So, I have created such a target less transition in my state chart :
The scenario I need to cover is this :
While in the imageReview state, I want to send the event
nextImgon a button press. So, somehow I need to receive this signal, select the next image and set the
image.sourceto the newly selected image. I don't want to leave the imageReview state.
Somehow, I can't figure out how I can listen for this particular signal.
Can someone give me some hint how to handle that purely in QML ?
If you want to connect for particular signal, first define the function in QML and use Connections object or <id>.signalName.connect(..) to connect with particular handler.