[Qt-interest] Qt State machine framework

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Sat Mar 13 13:16:18 CET 2010


>> Any thoughts?
>>
>
> Like K. Frank suggested, use a history state.
>
> 1. Create a group state that has s1, s2, s3, and a history state h1, as
> its children. Create the transitions from s1, s2, s3 to s4 like before.
> 2. From s4 (which is _not_ a child of the group state from 1) ), add a
> transition with h1 as its target
>
> The state machine algorithm should take care of the rest (actually
> saving / restoring the state).

Thanks Frank, Kent.

I had read the history state section of Qt statemachine documentation
but somehow could not map my requirement to it, then! :(

I agree that storing the state was a hack and not the fsm way of doing
it. Another approach that I thought, though not very efficient, was,
when we are in s4, I post different events for each of the states
s1/2/3 and add transitions for the same. Though this would mean that
as the states increased, I would have add those many events and
transitions.

Thanks again.

-mandeep

>
> Kent
>
> _______________________________________________
> 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