summaryrefslogtreecommitdiffstats
path: root/src/gui/accessible/qaccessiblecache.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-03-20 16:38:36 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-09 10:46:02 +0200
commitccdfe354a64d145fc457d123c5d9b0bf15575738 (patch)
treed4fb1a3ba601797d56de49e3fb54e52a608f0f88 /src/gui/accessible/qaccessiblecache.cpp
parent7537a4605ad65a039f5e9812939a13fbf7656e29 (diff)
Accessibility Mac: Cache Accessible Elements and Notify about changes
The big change is that we now keep the id objects representing accessibles around so that they are persistent for ATs. This improves performance of Mac accessibility significantly. This is required for notifications which are now sent so that many things work much better, for example the VoiceOver focus follows the keyboard focus. The parent element in QCocoaAccessibleElement was removed, we can dynamically access it more reliably. Change-Id: I686d212f40d28b392dcc22f16f3c3430f08bdc98 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/gui/accessible/qaccessiblecache.cpp')
-rw-r--r--src/gui/accessible/qaccessiblecache.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/accessible/qaccessiblecache.cpp b/src/gui/accessible/qaccessiblecache.cpp
index fe66c6e19d..09c155515e 100644
--- a/src/gui/accessible/qaccessiblecache.cpp
+++ b/src/gui/accessible/qaccessiblecache.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
@@ -49,6 +49,13 @@ QT_BEGIN_NAMESPACE
\brief Maintains a cache of accessible interfaces.
*/
+Q_GLOBAL_STATIC(QAccessibleCache, qAccessibleCache)
+
+QAccessibleCache *QAccessibleCache::instance()
+{
+ return qAccessibleCache;
+}
+
/*
The ID is always in the range [INT_MAX+1, UINT_MAX].
This makes it easy on windows to reserve the positive integer range
@@ -113,6 +120,10 @@ void QAccessibleCache::deleteInterface(QAccessible::Id id, QObject *obj)
if (obj)
objectToId.remove(obj);
delete iface;
+
+#ifdef Q_OS_MACX
+ removeCocoaElement(id);
+#endif
}
QT_END_NAMESPACE