From 80872d0a450d4179e66121d8efe01929ad56fb05 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 23 Mar 2012 17:42:09 +0100 Subject: Create accessible interfaces only for items with attached prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the attached property is not found, ignore the item, unless it is part of the tree. We still create a valid hierarchy this way, but filter out all irrelevant items. The same goes for hit-testing. On the other hand this patch enables the root item to be found by setting isAccessible on it when updating the flags. Otherwise the hierarchy is not valid again. Change-Id: Ied422fd0506d13458757c87a5dad7cdb9d3079bf Reviewed-by: Jan-Arve Sæther --- tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tests/auto/quick/qquickaccessible') diff --git a/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp b/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp index ca04751aae..45a9d11c69 100644 --- a/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp +++ b/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp @@ -345,15 +345,17 @@ void tst_QQuickAccessible::hitTest() QAI rootItem = QAI(canvasIface->child(0)); QRect rootRect = rootItem->rect(); - // hit the root item - QAI rootItemIface(canvasIface->childAt(rootRect.x() + 200, rootRect.y() + 50)); - QVERIFY(rootItemIface); - QCOMPARE(rootRect, rootItemIface->rect()); + // check the root item from app + QAI appIface = QAI(QAccessible::queryAccessibleInterface(qApp)); + QVERIFY(appIface); + QAI itemHit(appIface->childAt(rootRect.x() + 200, rootRect.y() + 50)); + QVERIFY(itemHit); + QCOMPARE(rootRect, itemHit->rect()); // hit rect1 QAI rect1(rootItem->child(0)); QRect rect1Rect = rect1->rect(); - rootItemIface = QAI(rootItem->childAt(rect1Rect.x() + 10, rect1Rect.y() + 10)); + QAI rootItemIface = QAI(rootItem->childAt(rect1Rect.x() + 10, rect1Rect.y() + 10)); QVERIFY(rootItemIface); QCOMPARE(rect1Rect, rootItemIface->rect()); QCOMPARE(rootItemIface->text(QAccessible::Name), QLatin1String("rect1")); -- cgit v1.2.3