[Qt-interest] Finding out which Parallel state a SM is in

Sean Harmer sean.harmer at maps-technology.com
Thu Jun 17 10:27:27 CEST 2010


Hi,

On Thursday 17 June 2010 06:38:54 Mandeep Sandhu wrote:
> Is there a way, for a "sibling" state, to find out what parallel state
> it's other sibling is in?
<snip>
> * Can I use QStateMachine::configuration()? I suspect this will give a
> list of top-level states (not the final child state that I'm
> interested in)?

Yes you can use:

machine()->configuration()

from your sibling parallel state. The QSet<QAbstractState*> that is returned 
contains the complete set of states, and not just the top-level states as you 
suggested. We use this all of the time to add some degree of inter-dependence 
between parallel states.

Cheers,

Sean



More information about the Qt-interest-old mailing list