summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2011-09-13 16:23:33 +0200
committerQt by Nokia <qt-info@nokia.com>2011-09-16 08:54:47 +0200
commitb62adb5dda803ef85379669f9884243c0f814737 (patch)
tree8d4ddb6b818108bc3b3e0fc7267b7a586505262d
parentf005dee1b3692a09e47782dcff9b5b07aa659b51 (diff)
For complex widgets try to return accessible interfaces.
Some of the complex' widgets children can return QAccessibleInterfaces. Ideally all complex widgets should be removed, this eases the transition. Change-Id: If3d7f28f97dac8cf5018a2c4c4b33709a3d4595c Reviewed-on: http://codereview.qt-project.org/4788 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
-rw-r--r--src/widgets/accessible/qaccessiblewidget.cpp6
-rw-r--r--tests/auto/qaccessibility/tst_qaccessibility.cpp5
2 files changed, 8 insertions, 3 deletions
diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp
index 76b6cf300a..7b8135f836 100644
--- a/src/widgets/accessible/qaccessiblewidget.cpp
+++ b/src/widgets/accessible/qaccessiblewidget.cpp
@@ -467,8 +467,12 @@ int QAccessibleWidget::navigate(RelationFlag relation, int entry,
break;
case Child:
if (complexWidget) {
- if (entry > 0 && entry <= childCount())
+ if (entry > 0 && entry <= childList.size()) {
+ targetObject = childList.at(entry - 1);
+ break;
+ } else if (entry > childList.size() && entry <= childCount()) {
return entry;
+ }
return -1;
}else {
if (entry > 0 && childList.size() >= entry)
diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp
index ac4e34a564..82e3b06a6f 100644
--- a/tests/auto/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp
@@ -1379,8 +1379,9 @@ void tst_QAccessibility::tabWidgetTest()
QCOMPARE(tabBarInterface->role(0), QAccessible::PageTabList);
QAccessibleInterface* tabButton1Interface = 0;
- QCOMPARE(tabBarInterface->navigate(QAccessible::Child, 1 , &tabButton1Interface), 1);
- QVERIFY(tabButton1Interface == 0);
+ QCOMPARE(tabBarInterface->navigate(QAccessible::Child, 1 , &tabButton1Interface), 0);
+ QVERIFY(tabButton1Interface);
+ delete tabButton1Interface;
QCOMPARE(tabBarInterface->role(1), QAccessible::PageTab);
QCOMPARE(tabBarInterface->text(QAccessible::Name, 1), QLatin1String("Tab 1"));