1import QtQuick 1.0 2 3Rectangle { 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} 31