title: qml run javascript code after state change
body: <p>I have several states which I use only to change some properties:</p>
  
  <pre><code>Item {
      id: props
      property int someProperty: 0
      // ...
  
      states: [
          State {
              name: "firstState"
              PropertyChange {
                  target: props
                  someProperty: 1
                  // ...
              }
          },
          State {
              name: "secondState"
              PropertyChange {
                  target: props
                  someProperty: 1
                  // ...
              }
          }
      ]
      onStateChange: doSomething(someProperty)
  }
  </code></pre>
  
  <p>Since different states could have the same value for <code>someProperty</code> I can't rely on the <code>somePropertyChange</code> signal, but I can't even rely on the <code>onStateChange</code> (as in the example) since when it runs the properties are unchanged. </p>
  
  <p>So how could I run <code>doSomething()</code> every time the state change? There is a better way to do this kind of things with <code>QML</code>?</p>