tests/auto/declarative/qdeclarativestates/data/parentChange1.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     Item {
       
     6         x: 10; y: 10
       
     7         Rectangle {
       
     8             id: myRect
       
     9             objectName: "MyRect"
       
    10             x: 5
       
    11             width: 100; height: 100
       
    12             color: "red"
       
    13         }
       
    14     }
       
    15     MouseArea {
       
    16         id: clickable
       
    17         anchors.fill: parent
       
    18     }
       
    19 
       
    20     Item {
       
    21         x: -100; y: -50
       
    22         Item {
       
    23             id: newParent
       
    24             objectName: "NewParent"
       
    25             x: 248; y: 360
       
    26         }
       
    27     }
       
    28 
       
    29     states: State {
       
    30         name: "reparented"
       
    31         when: clickable.pressed
       
    32         ParentChange {
       
    33             target: myRect
       
    34             parent: newParent
       
    35         }
       
    36     }
       
    37 }