diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-06-17 01:36:30 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-06-17 05:10:46 (GMT) |
commit | bba51197a1f99a5c77c2747de2ecd399fdb638a0 (patch) | |
tree | 0f22777aeec5daba0acab8be64e67499dee37c4b /tests/auto/declarative/qdeclarativeitem/data | |
parent | efc8b0c9c97a84097bc7f62a109e455caa8b2279 (diff) | |
download | Qt-bba51197a1f99a5c77c2747de2ecd399fdb638a0.zip Qt-bba51197a1f99a5c77c2747de2ecd399fdb638a0.tar.gz Qt-bba51197a1f99a5c77c2747de2ecd399fdb638a0.tar.bz2 |
Properly update childrenRect for position changes and shrinking.
Task-number: QTBUG-11465
Diffstat (limited to 'tests/auto/declarative/qdeclarativeitem/data')
-rw-r--r-- | tests/auto/declarative/qdeclarativeitem/data/childrenRectBug2.qml | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug2.qml b/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug2.qml new file mode 100644 index 0000000..225d8d4 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeitem/data/childrenRectBug2.qml @@ -0,0 +1,53 @@ +import Qt 4.7 + +Rectangle { + width:360; + height: 200 + + Item { + objectName: "theItem" + anchors.centerIn: parent + width: childrenRect.width + height: childrenRect.height + Rectangle { + id: header1 + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + width: 100; height: 50 + color: "green" + } + Rectangle { + id: text1 + anchors.top: header1.bottom + anchors.topMargin: 10 + anchors.horizontalCenter: parent.horizontalCenter + width: 100; height: 50 + color: "blue" + } + } + + states: [ + State { + name: "row" + AnchorChanges { + target: header1 + anchors.horizontalCenter: undefined + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.top: undefined + } + AnchorChanges { + target: text1 + anchors.horizontalCenter: undefined + anchors.verticalCenter: parent.verticalCenter + anchors.top: undefined + anchors.left: header1.right + } + PropertyChanges { + target: text1 + anchors.leftMargin: 10 + anchors.topMargin: 0 + } + } + ] +} |