diff options
author | Kari Hautamäki <kari.hautamaki@theqtcompany.com> | 2015-04-21 08:44:24 +0300 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@theqtcompany.com> | 2016-02-24 05:56:00 +0000 |
commit | fb2710a7f182ffb910f6b121e8bc125a4f61dcdf (patch) | |
tree | 757a0f40df12e683a7085f844d42f10344aa62c1 /tests/auto/quick/qquickitem2 | |
parent | 4e7f570f921671c627040537b4dd8cdb77bda3d1 (diff) |
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 <shawn.rutledge@theqtcompany.com>
Diffstat (limited to 'tests/auto/quick/qquickitem2')
-rw-r--r-- | tests/auto/quick/qquickitem2/tst_qquickitem.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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<QQuickItem *>(0)); QCOMPARE(parent.childAt(300, 300), static_cast<QQuickItem *>(0)); |