tests/auto/declarative/qdeclarativeitem/data/childrenRectBug2.qml
changeset 33 3e2da88830cd
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
       
     1 import Qt 4.7
       
     2 
       
     3 Rectangle {
       
     4     width:360;
       
     5     height: 200
       
     6 
       
     7     Item {
       
     8         objectName: "theItem"
       
     9         anchors.centerIn: parent
       
    10         width: childrenRect.width
       
    11         height: childrenRect.height
       
    12         Rectangle {
       
    13             id: header1
       
    14             anchors.horizontalCenter: parent.horizontalCenter
       
    15             anchors.top: parent.top
       
    16             width: 100; height: 50
       
    17             color: "green"
       
    18         }
       
    19         Rectangle {
       
    20             id: text1
       
    21             anchors.top: header1.bottom
       
    22             anchors.topMargin: 10
       
    23             anchors.horizontalCenter: parent.horizontalCenter
       
    24             width: 100; height: 50
       
    25             color: "blue"
       
    26         }
       
    27     }
       
    28 
       
    29     states: [
       
    30     State {
       
    31         name: "row"
       
    32         AnchorChanges {
       
    33             target: header1
       
    34             anchors.horizontalCenter: undefined
       
    35             anchors.verticalCenter: parent.verticalCenter
       
    36             anchors.left: parent.left
       
    37             anchors.top: undefined
       
    38         }
       
    39         AnchorChanges {
       
    40             target: text1
       
    41             anchors.horizontalCenter: undefined
       
    42             anchors.verticalCenter: parent.verticalCenter
       
    43             anchors.top: undefined
       
    44             anchors.left: header1.right
       
    45         }
       
    46         PropertyChanges {
       
    47             target: text1
       
    48             anchors.leftMargin: 10
       
    49             anchors.topMargin: 0
       
    50         }
       
    51     }
       
    52     ]
       
    53 }