Results 1 to 2 of 2

Thread: QStateMachine - can a generic signal trigger a state transition?

  1. #1
    Join Date
    Aug 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QStateMachine - can a generic signal trigger a state transition?

    Hello everybody!
    I'm getting trouble understanding how to schedule a state transition based on a generic [COLOR="rgb(0, 0, 0)"]QObject signa[/COLOR]l.
    I mean, how can I make something like the following to work?
    start_state.addTransition(generic_object, SIGNAL(generic_signal), end_state);
    Is there any work-around to solve this?
    I'm also including a convenience code snapshot.
    Thanks for your help. Giovanni
    Attached Files Attached Files

  2. #2
    Join Date
    Aug 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QStateMachine - can a generic signal trigger a state transition?

    I think I can answer my own question. The answer is YES! and the problem was .. the even loop.
    Even if I already called the state machine's start() method, it doesn't process anything until the application event loop is made running.
    So events that occur in the meantime do not trigger the expected processing as setup by the addTransition call (they are NOT QUEUED, they get LOST).
    I posted a revised working version of my snapshot for the curious.
    Ciao a tutti.
    Attached Files Attached Files

Similar Threads

  1. Finding the current state of a QStateMachine
    By pherthyl in forum Qt Programming
    Replies: 3
    Last Post: 18th July 2012, 15:14
  2. generic catch-all error during runtime
    By babygal in forum Qt Programming
    Replies: 7
    Last Post: 23rd June 2010, 08:53
  3. Replies: 0
    Last Post: 24th May 2010, 08:11
  4. Generic Component Framework
    By prashanthudupa in forum Qt-based Software
    Replies: 5
    Last Post: 4th October 2007, 12:16
  5. Replies: 5
    Last Post: 9th May 2007, 21:31

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.