Use QGuiApp::activeWindow()->accessibleRoot() to find focus child
authorJan-Arve Saether <jan-arve.saether@nokia.com>
Thu, 22 Sep 2011 15:21:36 +0000 (17:21 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 3 Oct 2011 07:56:09 +0000 (09:56 +0200)
queryAccessibleInterface will return 0 if the object is a QWindow, so
it would never find the focus child.

Change-Id: Ib5bb6a0e4ffbf1b8491b71d1ba5a039e7a6584e0
Reviewed-on: http://codereview.qt-project.org/5842
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
src/gui/accessible/qaccessibleobject.cpp

index af32943..8fcab7f 100644 (file)
@@ -312,7 +312,10 @@ int QAccessibleApplication::navigate(RelationFlag relation, int entry,
         targetObject = object();
         break;
     case FocusChild:
-        targetObject = QGuiApplication::activeWindow();
+        if (QWindow *window = QGuiApplication::activeWindow()) {
+            *target = window->accessibleRoot();
+            return 0;
+        }
         break;
     case Ancestor:
         *target = parent();