aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/accessible/shared/qdeclarativeaccessible.cpp
diff options
context:
space:
mode:
authorJan-Arve Saether <jan-arve.saether@nokia.com>2012-01-03 09:40:16 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-12 12:21:59 +0100
commit9ab84bd46861557afb190ba4cb2481b35a7401e5 (patch)
tree32c2c128aa0783cbe0bfe9f43d437c9ac916a929 /src/plugins/accessible/shared/qdeclarativeaccessible.cpp
parent0cafd920cced1f726a8b6422b6fb496ecf846f34 (diff)
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>
Diffstat (limited to 'src/plugins/accessible/shared/qdeclarativeaccessible.cpp')
-rw-r--r--src/plugins/accessible/shared/qdeclarativeaccessible.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/accessible/shared/qdeclarativeaccessible.cpp b/src/plugins/accessible/shared/qdeclarativeaccessible.cpp
index 7db5f07cbe..1b35594e74 100644
--- a/src/plugins/accessible/shared/qdeclarativeaccessible.cpp
+++ b/src/plugins/accessible/shared/qdeclarativeaccessible.cpp
@@ -70,9 +70,8 @@ QFlags<QAccessible::RelationFlag> QDeclarativeAccessible::relationTo(const QAcce
QAccessibleInterface *QDeclarativeAccessible::childAt(int x, int y) const
{
- // Look for children first.
- // Start with the last child first, because children are ordered in paint order
- // (which is opposite of hit test order)
+ // Note that this function will disregard stacking order.
+ // (QAccessibleQuickView::childAt() does this correctly and more efficient)
// If the item clips its children, we can return early if the coordinate is outside its rect
if (clipsChildren()) {