How to receive and react to statemachine targetless transitions ?
-
Hi,
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
nextImg
on a button press. So, somehow I need to receive this signal, select the next image and set theimage.source
to 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 ?
Thx,
YenZi
-
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.