tests/auto/declarative/qdeclarativestates/data/parentChange4.qml
branchGCC_SURGE
changeset 31 5daf16870df6
parent 30 5dc02b23752f
equal deleted inserted replaced
27:93b982ccede2 31:5daf16870df6
       
     1 import Qt 4.7
       
     2 
       
     3 Rectangle {
       
     4     width: 400; height: 400
       
     5     Rectangle {
       
     6         id: myRect
       
     7         objectName: "MyRect"
       
     8         x: 5; y: 5
       
     9         width: 100; height: 100
       
    10         color: "red"
       
    11     }
       
    12     MouseArea {
       
    13         id: clickable
       
    14         anchors.fill: parent
       
    15     }
       
    16 
       
    17     Item {
       
    18         id: newParent
       
    19         transform: Scale { xScale: .5; yScale: .7}
       
    20     }
       
    21 
       
    22     states: State {
       
    23         name: "reparented"
       
    24         when: clickable.pressed
       
    25         ParentChange {
       
    26             target: myRect
       
    27             parent: newParent
       
    28         }
       
    29     }
       
    30 }