summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-03-05 03:56:47 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-03-05 03:56:47 (GMT)
commit0c558e05f880cb51078b2d5e5281227352c1de3f (patch)
tree809e95ab06fc5d757c1d66493de5c9376866aee1 /tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml
parentaf81ea8a5abbd9a94eb6ab5c3fe0425779905d5a (diff)
parent48fd47f64f3f73e82016161d82cdf67908a9c653 (diff)
downloadQt-0c558e05f880cb51078b2d5e5281227352c1de3f.zip
Qt-0c558e05f880cb51078b2d5e5281227352c1de3f.tar.gz
Qt-0c558e05f880cb51078b2d5e5281227352c1de3f.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml')
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml b/tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml
new file mode 100644
index 0000000..40a2106
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeitem/data/mapCoordinates.qml
@@ -0,0 +1,43 @@
+import Qt 4.6
+
+Item {
+ id: root; objectName: "root"
+ width: 200; height: 200
+
+ Item { id: itemA; objectName: "itemA"; x: 50; y: 50 }
+
+ Item {
+ x: 50; y: 50
+ Item { id: itemB; objectName: "itemB"; x: 100; y: 100 }
+ }
+
+ function mapAToB(x, y) {
+ var pos = itemA.mapToItem(itemB, x, y)
+ return Qt.point(pos.x, pos.y)
+ }
+
+ function mapAFromB(x, y) {
+ var pos = itemA.mapFromItem(itemB, x, y)
+ return Qt.point(pos.x, pos.y)
+ }
+
+ function mapAToNull(x, y) {
+ var pos = itemA.mapToItem(null, x, y)
+ return Qt.point(pos.x, pos.y)
+ }
+
+ function mapAFromNull(x, y) {
+ var pos = itemA.mapFromItem(null, x, y)
+ return Qt.point(pos.x, pos.y)
+ }
+
+ function checkMapAToInvalid(x, y) {
+ var pos = itemA.mapToItem(1122, x, y)
+ return pos.x == undefined && pos.y == undefined
+ }
+
+ function checkMapAFromInvalid(x, y) {
+ var pos = itemA.mapFromItem(1122, x, y)
+ return pos.x == undefined && pos.y == undefined
+ }
+}