From fb2710a7f182ffb910f6b121e8bc125a4f61dcdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kari=20Hautam=C3=A4ki?= Date: Tue, 21 Apr 2015 08:44:24 +0300 Subject: Determine QQuickItem::childAt() correctly [ChangeLog][QtQuick][QQuickItem] Fix to wrong calculation of child at a given point. Previously coordinates of width+1 and height+1 were counted as a child. That caused a child Rect of (0, 0, 100, 100) to be reported as a child at (100, 100), which is wrong (correct max coordinate is (99, 99).) Task-number: QTBUG-41833 Change-Id: I6124a275a5dc1a38eab448235102d563e2a8b0ca Reviewed-by: Shawn Rutledge --- tests/auto/quick/qquickitem2/tst_qquickitem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/quick/qquickitem2/tst_qquickitem.cpp') diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp index b4131a2df8..62ff09e698 100644 --- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp +++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp @@ -2995,12 +2995,12 @@ void tst_QQuickItem::childAt() child3.setParentItem(&parent); QCOMPARE(parent.childAt(0, 0), &child1); - QCOMPARE(parent.childAt(0, 100), &child1); + QCOMPARE(parent.childAt(0, 99), &child1); QCOMPARE(parent.childAt(25, 25), &child1); QCOMPARE(parent.childAt(25, 75), &child1); QCOMPARE(parent.childAt(75, 25), &child1); QCOMPARE(parent.childAt(75, 75), &child2); - QCOMPARE(parent.childAt(150, 150), &child2); + QCOMPARE(parent.childAt(149, 149), &child2); QCOMPARE(parent.childAt(25, 200), &child3); QCOMPARE(parent.childAt(0, 150), static_cast(0)); QCOMPARE(parent.childAt(300, 300), static_cast(0)); -- cgit v1.2.3