Commit 8cbbdae2 authored by Jan Arve Sæther's avatar Jan Arve Sæther
Browse files

Always invalidate the iOS accessibility cache


This was observed in the weather app, where sometimes we could not find
an items window. This could only be observed in the search results of
the cities. (while VKB was visible).

The old code traversed up to the QQuickListView and then it could not
traversed further up in the parent hierarchy. Because of this it
could also not find the associated window handle.
The reason for this is unknown, but maybe it could be related to the
fact that QQuickListView is a Component.

Regardless of this, invalidate the cache should invalidate everything.
We also traverse through all top level windows, but on iOS there should
not be too many top level windows...

Change-Id: I56a496435bb529a53d5ece8446cd2eeff502af84
Reviewed-by: default avatarFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>
parent 3b86bd54
Branches
Tags
No related merge requests found
Showing with 10 additions and 10 deletions
...@@ -58,16 +58,16 @@ void invalidateCache(QAccessibleInterface *iface) ...@@ -58,16 +58,16 @@ void invalidateCache(QAccessibleInterface *iface)
return; return;
} }
QWindow *win = 0; // This will invalidate everything regardless of what window the
QAccessibleInterface *parent = iface; // interface belonged to. We might want to revisit this strategy later.
do { // (Therefore this function still takes the interface as argument)
win = parent->window(); // It is also responsible for the bug that focus gets temporary lost
parent = parent->parent(); // when items get added or removed from the screen
} while (!win && parent); foreach (QWindow *win, QGuiApplication::topLevelWindows()) {
if (win && win->handle()) {
if (win && win->handle()) { QIOSWindow *window = static_cast<QIOSWindow*>(win->handle());
QIOSWindow *window = static_cast<QIOSWindow*>(win->handle()); window->clearAccessibleCache();
window->clearAccessibleCache(); }
} }
} }
......
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