Make QAccessibleQuickView::childAt() work properly with overlapping items
authorJan-Arve Saether <jan-arve.saether@nokia.com>
Tue, 3 Jan 2012 08:40:16 +0000 (09:40 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 12 Jan 2012 11:21:59 +0000 (12:21 +0100)
commit9ab84bd46861557afb190ba4cb2481b35a7401e5
tree32c2c128aa0783cbe0bfe9f43d437c9ac916a929
parent0cafd920cced1f726a8b6422b6fb496ecf846f34
Make QAccessibleQuickView::childAt() work properly with overlapping items

The previous code did not consider items that were overlapped due to
having different z coordinates.

The approach used is now the same as found in
QQuickCanvas::mousePressEvent().

Strictly speaking, this is a violation of childAt (since it will
disregard the implementation of childAt of all the descendants along
the path down to the item actually returned.)

However, I don't see any good reason for that the implementation for
childAt() would be different than how mousePressEvent behaves.
It should also perform better than any other solution I managed to
think of.

Change-Id: I2d3fa2282437c7b5533c6149c62fc456ccf2ccfa
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
src/plugins/accessible/quick/qaccessiblequickitem.cpp
src/plugins/accessible/quick/qaccessiblequickitem.h
src/plugins/accessible/quick/qaccessiblequickview.cpp
src/plugins/accessible/shared/qdeclarativeaccessible.cpp
tests/auto/declarative/qdeclarativeaccessibility/data/hittest.qml [new file with mode: 0644]
tests/auto/declarative/qdeclarativeaccessibility/data/widgets/TextRect.qml [new file with mode: 0644]
tests/auto/declarative/qdeclarativeaccessibility/tst_qdeclarativeaccessibility.cpp