Commit 6b87a9cf authored by Morten Johan Sorvig's avatar Morten Johan Sorvig Committed by Qt by Nokia
Browse files

Accessibility: childAt_helper descends too far.


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: default avatarJan-Arve Sæther <jan-arve.saether@nokia.com>
Reviewed-by: default avatarFrederik Gladhorn <frederik.gladhorn@nokia.com>
parent 16e29f30
No related merge requests found
Showing with 5 additions and 0 deletions
...@@ -119,6 +119,11 @@ static QQuickItem *childAt_helper(QQuickItem *item, int x, int y) ...@@ -119,6 +119,11 @@ static QQuickItem *childAt_helper(QQuickItem *item, int x, int y)
return 0; return 0;
} }
QScopedPointer<QAccessibleInterface> accessibleInterface(QAccessible::queryAccessibleInterface(item));
if (accessibleInterface->childCount() == 0) {
return (itemScreenRect(item).contains(x, y)) ? item : 0;
}
QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);
QList<QQuickItem *> children = itemPrivate->paintOrderChildItems(); QList<QQuickItem *> children = itemPrivate->paintOrderChildItems();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment