4 id: root; objectName: "root"
5 width: 200; height: 200
7 Item { id: itemA; objectName: "itemA"; x: 50; y: 50 }
11 Item { id: itemB; objectName: "itemB"; x: 100; y: 100 }
14 function mapAToB(x, y) {
15 var pos = itemA.mapToItem(itemB, x, y)
16 return Qt.point(pos.x, pos.y)
19 function mapAFromB(x, y) {
20 var pos = itemA.mapFromItem(itemB, x, y)
21 return Qt.point(pos.x, pos.y)
24 function mapAToNull(x, y) {
25 var pos = itemA.mapToItem(null, x, y)
26 return Qt.point(pos.x, pos.y)
29 function mapAFromNull(x, y) {
30 var pos = itemA.mapFromItem(null, x, y)
31 return Qt.point(pos.x, pos.y)
34 function checkMapAToInvalid(x, y) {
35 var pos = itemA.mapToItem(1122, x, y)
36 return pos.x == undefined && pos.y == undefined
39 function checkMapAFromInvalid(x, y) {
40 var pos = itemA.mapFromItem(1122, x, y)
41 return pos.x == undefined && pos.y == undefined