aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qquickitem2/data/childrenRectBug2.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qquickitem2/data/childrenRectBug2.qml')
-rw-r--r--tests/auto/declarative/qquickitem2/data/childrenRectBug2.qml53
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/auto/declarative/qquickitem2/data/childrenRectBug2.qml b/tests/auto/declarative/qquickitem2/data/childrenRectBug2.qml
new file mode 100644
index 0000000000..6e80ed28af
--- /dev/null
+++ b/tests/auto/declarative/qquickitem2/data/childrenRectBug2.qml
@@ -0,0 +1,53 @@
+import QtQuick 2.0
+
+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
+ }
+ }
+ ]
+}