Accessibility: Fix crash when accessing accessible children.
authorFrederik Gladhorn <frederik.gladhorn@digia.com>
Tue, 28 May 2013 13:06:25 +0000 (15:06 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 28 May 2013 17:35:13 +0000 (19:35 +0200)
The window would create new child interfaces every time
it's children are queried. Instead properly use the
crash.

Task-number: QTBUG-31417
Change-Id: Ifc7bbdbdb9a506fe04a348fba643f1d52a6157e7
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
src/plugins/accessible/quick/qaccessiblequickview.cpp

index b85f23c..1240b2e 100644 (file)
@@ -81,10 +81,8 @@ QAccessibleInterface *QAccessibleQuickWindow::parent() const
 
 QAccessibleInterface *QAccessibleQuickWindow::child(int index) const
 {
-    if (index == 0) {
-        if (QQuickItem *declarativeRoot = rootItem())
-            return new QAccessibleQuickItem(declarativeRoot);
-    }
+    if (index == 0)
+        return QAccessible::queryAccessibleInterface(rootItem());
     return 0;
 }