Results 1 to 3 of 3

Thread: QStateMachine and signals

  1. #1
    Join Date
    Mar 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QStateMachine and signals

    I've build a QStateMachine
    it changes states base on the signals
    Seems to work
    except if I emit signals in the loop it still move only on state
    (dose not seem to que the signals)
    I did wrote a slot to see the signals and
    I do get all the signals in the slot
    However QStateMachine only move one state (instead of 3)

    for example
    for (int i = 0; i < 3; ++i)
    {

    emit goNextState();

    }
    but it only moves one state
    What do I need to do?

    Thank you

    Ross

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QStateMachine and signals

    can you post some of your relevant code

  3. #3
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QStateMachine and signals

    Hi,

    Are the connections Queued? So I think that if multiple signals are emmited and the connection is Quedued then, them will be joined as only one signal.
    If you are not using threads you can try using Direct connections.
    If you are using threads maybe sending an dummy int value(different on every emit) on the signal will force the eventLoop to execute all the slots.
    Òscar Llarch i Galán

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.