aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickaccessible
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2012-03-23 17:42:09 +0100
committerQt by Nokia <qt-info@nokia.com>2012-04-10 21:03:04 +0200
commit80872d0a450d4179e66121d8efe01929ad56fb05 (patch)
treef00280e8b9b7f8d1d2386f0c41542edef01dc021 /tests/auto/quick/qquickaccessible
parent3bac6c910e87d28ddbbf0779d32bca72bc57dbd4 (diff)
Create accessible interfaces only for items with attached prop
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 <jan-arve.saether@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquickaccessible')
-rw-r--r--tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp12
1 files changed, 7 insertions, 5 deletions
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"));