aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickitem2/data
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquickitem2/data')
-rw-r--r--tests/auto/quick/qquickitem2/data/childrenRectBottomRightCorner.qml47
-rw-r--r--tests/auto/quick/qquickitem2/data/mapCoordinates.qml16
-rw-r--r--tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml16
-rw-r--r--tests/auto/quick/qquickitem2/data/tabFence.qml49
4 files changed, 120 insertions, 8 deletions
diff --git a/tests/auto/quick/qquickitem2/data/childrenRectBottomRightCorner.qml b/tests/auto/quick/qquickitem2/data/childrenRectBottomRightCorner.qml
new file mode 100644
index 0000000000..0b83e20b20
--- /dev/null
+++ b/tests/auto/quick/qquickitem2/data/childrenRectBottomRightCorner.qml
@@ -0,0 +1,47 @@
+import QtQuick 2.0
+
+Item {
+ width: 300
+ height: 300
+
+ Item {
+ anchors.centerIn: parent
+
+ Rectangle {
+ objectName: "childrenRectProxy"
+ x: container.childrenRect.x
+ y: container.childrenRect.y
+ width: container.childrenRect.width
+ height: container.childrenRect.height
+ color: "red"
+ opacity: 0.5
+ }
+
+ Item {
+ id: container
+
+ Rectangle {
+ x: -100
+ y: -100
+ width: 10
+ height: 10
+ color: "red"
+ }
+
+ Rectangle {
+ x: -60
+ y: -60
+ width: 10
+ height: 10
+ color: "red"
+ }
+ }
+
+ Rectangle {
+ id: origin
+ width: 5
+ height: 5
+ color: "black"
+ }
+ }
+}
diff --git a/tests/auto/quick/qquickitem2/data/mapCoordinates.qml b/tests/auto/quick/qquickitem2/data/mapCoordinates.qml
index 0b0b15a767..a9c5030e12 100644
--- a/tests/auto/quick/qquickitem2/data/mapCoordinates.qml
+++ b/tests/auto/quick/qquickitem2/data/mapCoordinates.qml
@@ -65,12 +65,20 @@ Item {
}
function checkMapAToInvalid(x, y) {
- var pos = itemA.mapToItem(1122, x, y)
- return pos == undefined;
+ try {
+ itemA.mapToItem(1122, x, y)
+ } catch (e) {
+ return e instanceof TypeError
+ }
+ return false
}
function checkMapAFromInvalid(x, y) {
- var pos = itemA.mapFromItem(1122, x, y)
- return pos == undefined;
+ try {
+ itemA.mapFromItem(1122, x, y)
+ } catch (e) {
+ return e instanceof TypeError
+ }
+ return false
}
}
diff --git a/tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml b/tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml
index e21aab1f01..c127407eae 100644
--- a/tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml
+++ b/tests/auto/quick/qquickitem2/data/mapCoordinatesRect.qml
@@ -66,12 +66,20 @@ Item {
}
function checkMapAToInvalid(x, y, w, h) {
- var pos = itemA.mapToItem(1122, x, y, w, h)
- return pos == undefined;
+ try {
+ itemA.mapToItem(1122, x, y, w, h)
+ } catch (e) {
+ return e instanceof TypeError
+ }
+ return false;
}
function checkMapAFromInvalid(x, y, w, h) {
- var pos = itemA.mapFromItem(1122, x, y, w, h)
- return pos == undefined;
+ try {
+ itemA.mapFromItem(1122, x, y, w, h)
+ } catch (e) {
+ return e instanceof TypeError
+ }
+ return false;
}
}
diff --git a/tests/auto/quick/qquickitem2/data/tabFence.qml b/tests/auto/quick/qquickitem2/data/tabFence.qml
new file mode 100644
index 0000000000..fcf69b418b
--- /dev/null
+++ b/tests/auto/quick/qquickitem2/data/tabFence.qml
@@ -0,0 +1,49 @@
+import QtQuick 2.1
+import Test 1.0
+
+Item {
+ objectName: "root"
+ focus: true
+ width: 800
+ height: 600
+
+ TabFence {
+ objectName: "fence1"
+
+ TextInput {
+ objectName: "input11"
+ activeFocusOnTab: true
+ }
+ TextInput {
+ objectName: "input12"
+ activeFocusOnTab: true
+ }
+ TextInput {
+ objectName: "input13"
+ activeFocusOnTab: true
+ }
+ }
+
+ TextInput {
+ objectName: "input1"
+ activeFocusOnTab: true
+ }
+
+ TextInput {
+ objectName: "input2"
+ activeFocusOnTab: true
+ }
+
+ TabFence {
+ objectName: "fence2"
+ }
+
+ TextInput {
+ objectName: "input3"
+ activeFocusOnTab: true
+ }
+
+ TabFence {
+ objectName: "fence3"
+ }
+}