summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-07-27 00:11:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-22 18:45:24 +0200
commit3abecf2ee9fc724af571f8c7da4302f7bee9eadb (patch)
tree2d727cd1d04e345a231ab4dcd99af1b9d2003b5b /src/gui
parent59b6a67b94fab5aa36a01beb0d8665575b678f64 (diff)
Accessibility for Android
This enables both modes for TalkBack, explore-by-touch and the normal swiping mode. It is partially inspired by the BarGraphView example of the Google/Android Eyes-Free project. Note that for any accessibility to work you'll need a device with api level 16 at least. Using reflection we should be able to dynamically pick up the classes if we have the high enough api level. Change-Id: I11b93bead451483782a1711434d45c8f9a35996f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/accessible/qaccessiblecache.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/accessible/qaccessiblecache.cpp b/src/gui/accessible/qaccessiblecache.cpp
index 1b79c30b6c..a9a880e71f 100644
--- a/src/gui/accessible/qaccessiblecache.cpp
+++ b/src/gui/accessible/qaccessiblecache.cpp
@@ -60,7 +60,9 @@ QAccessible::Id QAccessibleCache::acquireId() const
static QAccessible::Id lastUsedId = FirstId;
while (idToInterface.contains(lastUsedId)) {
- if (lastUsedId == UINT_MAX) // (wrap back when when we reach UINT_MAX)
+ // (wrap back when when we reach UINT_MAX - 1)
+ // -1 because on Android -1 is taken for the "View" so just avoid it completely for consistency
+ if (lastUsedId == UINT_MAX - 1)
lastUsedId = FirstId;
else
++lastUsedId;