Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to receive and react to statemachine targetless transitions ?

How to receive and react to statemachine targetless transitions ?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
statemachinetargettransitionreceiving messa
2 Posts 2 Posters 873 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    YenZi
    wrote on last edited by
    #1

    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 :

    0_1527712322259_Screen Shot 2018-05-30 at 22.31.41.png

    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 the image.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

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      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.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved