Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Transitions between child states of different composite states in DSM-Framework
Forum Updated to NodeBB v4.3 + New Features

Transitions between child states of different composite states in DSM-Framework

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 716 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    isnot2bad
    wrote on last edited by isnot2bad
    #1

    According to the last chapter of The State Machine Framework, when nesting state machines, source and target states of transitions are limited to states of the same state machine instance:

    (...) States of the child state machine cannot be specified as targets of transitions in the parent state machine; only the child state machine itself can. Conversely, states of the parent state machine cannot be specified as targets of transitions in the child state machine.(...)

    Does The Declarative State Machine Framework have these same limitation?

    My experiments show that it is possible to create a transition from a child state of one composite state to another state that is on the same level than the composite state, but I don't know if this works on purpose or accidentially:

    StateMachine {
    	initialState: father
    	
    	State {
    		id: father
    		initialState: child
    		onEntered: console.log("Entered: father");
    		onExited: console.log("Exited: father");
    		
    		State {
    			id: child
    			onEntered: console.log("Entered: child");
    			onExited: console.log("Exited state child");
    			
    			TimeoutTransition {
    				/* transition to outer state */
    				targetState: uncle
    				timeout: 5000
    			}
    		}
    	}
    
    	State {
    		id: uncle
    		onEntered: console.log("Entered: uncle");
    		onExited: console.log("Exited: uncle");
    	}
    }
    
    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi! The C++ and QML statemachines have a different code base and there are some differences in behaviour. Regarding your question, the documentation says:

      A transition can have any state as its target irrespective of where the target state is in the state hierarchy.

      So indeed it seems to be on purpose.

      1 Reply Last reply
      1
      • I Offline
        I Offline
        isnot2bad
        wrote on last edited by
        #3

        Thanks for the quick and helpful response.
        Seems I've missed that line in the documentation.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved