Details
-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
5.15.12
-
None
Description
When using AnchorChanges with a Transition my application makes the PropertyChanges to be triggered more than once.
I am able to reproduce the issue with this simple example:
import QtQuick 2.15 Rectangle { id: window width: 120; height: 120 color: "black" Rectangle { id: myRect; width: 50; height: 50; color: "red" onColorChanged: { console.log("new color: " + color) } } states: State { name: "reanchored" AnchorChanges { target: myRect anchors.top: window.top anchors.bottom: window.bottom } PropertyChanges { target: myRect anchors.topMargin: 10 anchors.bottomMargin: 10 color: "blue" } } MouseArea { anchors.fill: parent; onClicked: window.state = "reanchored" } //add this transitions: [Transition{}] }
where the output is
> new color: #0000ff
> new color: #ff0000
> new color: #0000ff
but if I comment out either the AchorChanges or the transitions, the output would be
> new color: #0000ff
I was expecting the color to be changed only once in both cases, is this expected?