Details
-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
5.12.0, 5.15.0, 6.0
Description
The problem is that when I assign binding to property inside 'PropertyChanges' and I wanted to make Transition between default and this State - properties of the "target" could be changed 2 times even before Transition was started.
In following example I wanted to assign binding to _target.opacity property
states: [ State { name: "shown" when: _target.shown PropertyChanges { target: _target; numberProperty: 100; opacity: _target.effectiveOpacity; visible: true } } ]
and I have following Transition:
Transition { to: "shown" SequentialAnimation { ScriptAction { script: console.warn("Transition '' -> 'shown' started"); } PropertyAction { target: _target property: "numberProperty" } NumberAnimation { target: _target property: "opacity" } ScriptAction { script: console.warn("Transition '' -> 'shown' finished"); } } }
After running this application and change _target state to "shown" in the output we will see that property 'numberProperty' was changed 2 times for unknown reason. (Video: property-changes-with-binding.mkv)
This is the simplest example I could come up with and still reproduce it (on practice I have another binding on 'numberProperty' and extra change of this property outside controllable Transition could produce negative side-effects)
But when I remove binding from declaration and use simple value - no extra changes occurred and everything works fine as expected
states: [ State { name: "shown" when: _target.shown PropertyChanges { target: _target; numberProperty: 100; opacity: 1.0; visible: true } } ]
Please find test-project in attachments and video how I've captured this issue.
P.S. Please correct me with better way to achieve binding assignment as part of PropertyChanges declaration without extra changes of another properties
Thanks