Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
4.7.1, 5.0.0
-
None
Description
Given: two states; one state(name it AncState) has element anchoring changes and the other state(name it PosState) has absolute positioning changes of the same element.
Action: If PosState is the first state then work will be done correctly all the way.
If AncState is the first state then absolute positioning will be ignored until we explicitly set the anchors to undefined.
"Code for reproducing the bug"
import QtQuick 1.0 Rectangle { id: container height: 100 width: 100 Text{ id: text text: "some text" } MouseArea{ anchors.fill: parent onClicked: container.state = "state1" onDoubleClicked: container.state = "state2" } states:[ State{ name: "state1" AnchorChanges{target: text; anchors.horizontalCenter: container.horizontalCenter} PropertyChanges{target: text; y: 30} }, State{ name: "state2" PropertyChanges{target: text; x: 30; y: 30} } ] }
Workarounds:
First
onClicked: container.state = "state2" onDoubleClicked: container.state = "state1"
Second
State{
name: "state2"
AnchorChanges{target: text; anchors.horizontalCenter: undefined}
PropertyChanges{target: text; x: 30; y: 30}
}