I have several states that I use only to change some properties:
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) }
Since different states may have the same value for someProperty , I cannot rely on the signal somePropertyChange , but I cannot even rely on onStateChange (as in the example), because when it runs the properties do not change.
So, how could I run doSomething() every time a state changes? Is there a better way to do such things with QML ?
source share