Synchronous usage of state machines



  • Is there any way (or workaround) to use Qt State Machine Framework synchronously without message loop?

    Problem in fact, that we plan to use state machines for internal logic of the feature which will be launched without GUI (no normal message loop). Local message loops after any operation with state machine also aren't desirable, especially when this can lead to unnecessary message processing (GUI, timers, etc).



  • Does anybody know the answer?


  • Lifetime Qt Champion

    Hi,

    The QStateMachine has it's own event loop that doesn't depend on the GUI event loop, so you should not have interference problem.

    Does it help ?



  • The only restriction is that you have to use a QThread.



  • [quote author="SGaist" date="1373835054"]Hi,

    The QStateMachine has it's own event loop that doesn't depend on the GUI event loop, so you should not have interference problem.

    Does it help ?[/quote]

    [quote author="belab" date="1373912198"]The only restriction is that you have to use a QThread.[/quote]

    Thanks! I've tried with QThread and its event loop and have ensured that this solution is not acceptable for us. It's more safe and easy to use true synchronous state machine instead of complex workaround with QThread and synchronization issues.


  • Lifetime Qt Champion

    You might want to bring this point on the mailing list, you could catch some other ideas that could be good. The list is were you'll find the developers/maintainers, this forum is more user oriented.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.