[Qt-interest] unable to use more than 1 transition added to a state (QT StateMachine Framework)
Mandeep Sandhu
mandeepsandhu.chd at gmail.com
Wed Mar 17 09:56:01 CET 2010
On further debugging this problem I found that the issue is because of
attaching the same transition to more than 1 state.
Can't a transition be attached to more than 1 state?
Eg. If i define my transition as "On event E1, move to State S1"
I attach this transition to S3 and S6...now if an event E1 occurs
while the state machine is in S3 or S6, it should transition to S1.
Correct?
Or is this a bug in the state machine framework?
Thanks,
-mandeep
On Tue, Mar 16, 2010 at 7:39 PM, Mandeep Sandhu
<mandeepsandhu.chd at gmail.com> wrote:
> Hi All,
>
> I'm implementing my FSM which reacts to User QEvents (event type >
> QEvent::User). An external app does postEvent(QEvent) to the state
> machine.
>
> As part of that I'm implementing my own custom transition which
> extends QtAbstractTransition and reimplements the eventTest() method
> as shown here:
>
> http://doc.qt.nokia.com/4.6/statemachine-api.html#events-transitions-and-guards
>
> However, if I add more than one such transition to my state (say to
> S3) then the statemachine is unable to find any transition and remains
> stuck at S3. I've seen the code in example/eventtransitions where they
> add TWO QEventTransition's to a state and it seems to be working fine.
> I have set valid target states to these transitions.
>
> Note that if add only ONE transition, then it works fine, as in on the
> correct event I transition to the next state.
>
> Any clues as howto further debug this issue?
>
> thanks,
> -mandeep
>
More information about the Qt-interest-old
mailing list