summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorJan Arve Sæther <jan-arve.saether@theqtcompany.com>2014-10-30 16:05:46 +0100
committerJan Arve Sæther <jan-arve.saether@theqtcompany.com>2014-11-01 00:09:13 +0100
commit8cbbdae24c8c3cb0de015c2df3e27c20cb836083 (patch)
tree8ff466c336d8403977ded1e72d6f2d325b022306 /src/plugins/platforms
parent3b86bd5406d9e4b2a3778d5b4e16a371124afc80 (diff)
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: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/ios/qiosplatformaccessibility.mm20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/plugins/platforms/ios/qiosplatformaccessibility.mm b/src/plugins/platforms/ios/qiosplatformaccessibility.mm
index ad8bd9bdf4..705c626272 100644
--- a/src/plugins/platforms/ios/qiosplatformaccessibility.mm
+++ b/src/plugins/platforms/ios/qiosplatformaccessibility.mm
@@ -58,16 +58,16 @@ void invalidateCache(QAccessibleInterface *iface)
return;
}
- QWindow *win = 0;
- QAccessibleInterface *parent = iface;
- do {
- win = parent->window();
- parent = parent->parent();
- } while (!win && parent);
-
- if (win && win->handle()) {
- QIOSWindow *window = static_cast<QIOSWindow*>(win->handle());
- window->clearAccessibleCache();
+ // This will invalidate everything regardless of what window the
+ // interface belonged to. We might want to revisit this strategy later.
+ // (Therefore this function still takes the interface as argument)
+ // It is also responsible for the bug that focus gets temporary lost
+ // when items get added or removed from the screen
+ foreach (QWindow *win, QGuiApplication::topLevelWindows()) {
+ if (win && win->handle()) {
+ QIOSWindow *window = static_cast<QIOSWindow*>(win->handle());
+ window->clearAccessibleCache();
+ }
}
}