Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.8.0
-
None
-
Mac OS 10.5/Cocoa
-
8ab760b70e13318749bcc83e33b9a9b9a849a892
Description
In the following example, when selecting the text and set it to an empty string, the black rectangle falls to the bottom as expected. But when writing some text back in, the location of the rectangle is not restored. It will work if I choose to use PropertyChanges instead, which reveals that either this is a bug or an inconsistency in QML.
import Qt 4.7 Rectangle { id: root width:300; height:400 TextEdit { id: e1 anchors.horizontalCenter: root.horizontalCenter text: "<clear this text to move rectangle>" } Rectangle { id: rectangle color: "black" width:50; height:50 y: 50 states: [ State { when: e1.text == "" AnchorChanges { target: rectangle anchors.bottom: root.bottom } // PropertyChanges { // target: rectangle // y: 200 // } } ] } }