From 6b87a9cfe51f7ad4e12aca59fdcb0ed242e47e90 Mon Sep 17 00:00:00 2001 From: Morten Johan Sorvig Date: Thu, 19 Jan 2012 08:02:09 +0100 Subject: [PATCH] Accessibility: childAt_helper descends too far. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Recursive hit-testing using childAt_helper must stop when it hits a leaf accessibility item. This leaf item might not be a leaf item in Qt Quick - a button contains text and mouse area items not visible to the accessibility system for example. Get the accessible interface and check if it has children before recursing to the child items. Change-Id: I2cc286cde4bce6b4ca340e8a1819edc5f84006a5 Reviewed-by: Jan-Arve Sæther Reviewed-by: Frederik Gladhorn --- src/plugins/accessible/quick/qaccessiblequickview.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/accessible/quick/qaccessiblequickview.cpp b/src/plugins/accessible/quick/qaccessiblequickview.cpp index 042d8dc..1823dfe 100644 --- a/src/plugins/accessible/quick/qaccessiblequickview.cpp +++ b/src/plugins/accessible/quick/qaccessiblequickview.cpp @@ -119,6 +119,11 @@ static QQuickItem *childAt_helper(QQuickItem *item, int x, int y) return 0; } + QScopedPointer accessibleInterface(QAccessible::queryAccessibleInterface(item)); + if (accessibleInterface->childCount() == 0) { + return (itemScreenRect(item).contains(x, y)) ? item : 0; + } + QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); QList children = itemPrivate->paintOrderChildItems(); -- 2.7.4