[Qt-interest] Qt State machine framework

noam.rosenthal at nokia.com noam.rosenthal at nokia.com
Fri Mar 12 06:33:08 CET 2010


Hi Mandeep
Actually both things are supported!

1. http://doc.trolltech.com/4.6/qabstracttransition.html#triggered: A signal that gets emitted when a transition is triggered. You can then query the tranistion's source/target properties.
2. http://doc.trolltech.com/4.6/qstatemachine.html#configuration: QStateMachine::configuration(), returns a set of current states.

Hope this answers your question,

Regards
No'am 

>-----Original Message-----
>From: qt-interest-bounces at trolltech.com 
>[mailto:qt-interest-bounces at trolltech.com] On Behalf Of ext 
>Mandeep Sandhu
>Sent: Friday, March 12, 2010 2:20 PM
>To: qt-interest at trolltech.com
>Subject: [Qt-interest] Qt State machine framework
>
>Hi All,
>
>I'm planning to implement a FSM for one of my apps using the 
>Qt State machine framework. I have some requirements which 
>somehow are not there in this frame work by default (maybe I'm 
>missing something).
>They are:
>
>* I need to emit a signal whenever the FSM transitions from 1 
>state to another. The signal emits the old state and the new state
>* I need to provide an API to a caller to let it know what the 
>current state the FSM is in.
>
>For the 1st requirement I could not find an existing API's 
>which can do that (only started, stopped, finished signals are 
>emitted by the qtstatemachine class).
>
>I can think of many ways to do it, eg: create my own 
>transition and emit a signal in it's onTransition() method, 
>create my own state (subclassing the QtAbstractState and emit 
>a signal in it's onEntry method...though I won't have the 
>previous state then...)
>
>For the second part I need to keep updating some member of my 
>class to keep track of the current state (lame).
>
>Any suggestions on better approaches (if any)?
>
>Thanks,
>-mandeep
>_______________________________________________
>Qt-interest mailing list
>Qt-interest at trolltech.com
>http://lists.trolltech.com/mailman/listinfo/qt-interest
>



More information about the Qt-interest-old mailing list