Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
4.8.1
-
None
Description
When I define any anchor property changes inside new state definition, the state transition modifies other properties in strange way:
Example:
import QtQuick 1.0
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 }PropertyChanges
{ target: myRect color: "green" }}
MouseArea
{ anchors.fill: parent; onClicked: window.state = "reanchored" }}
Based on this code, myRect should change color from "red" to "green", but in console log I get:
new color: #008000
new color: #ff0000
new color: #008000
why the property is set to previous value during the transition ? It only occurs when I try to modify anchors in states