diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2014-09-03 13:47:42 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2014-09-20 00:21:30 +0200 |
commit | bbacf3d79d5067c4f9351400b5c1e0028cd093a5 (patch) | |
tree | 2618771ee6728deffb9dc3bc850c993d66331f87 /src/gui/accessible/qaccessible.cpp | |
parent | 076d22efa63de107d36ec33d978e6365f70a1f15 (diff) |
a11y: Don't try to update accessibility if there's no interface
Change-Id: I970729e65ba0eb857e6974f9947f27ae8e6410c3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'src/gui/accessible/qaccessible.cpp')
-rw-r--r-- | src/gui/accessible/qaccessible.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index 50f023ec78..1d70598c39 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -861,15 +861,20 @@ void QAccessible::setRootObject(QObject *object) */ void QAccessible::updateAccessibility(QAccessibleEvent *event) { - if (!isActive()) + // NOTE: Querying for the accessibleInterface below will result in + // resolving and caching the interface, which in some cases will + // cache the wrong information as updateAccessibility is called + // during construction of widgets. If you see cases where the + // cache seems wrong, this call is "to blame", but the code that + // caches dynamic data should be updated to handle change events. + if (!isActive() || !event->accessibleInterface()) return; #ifndef QT_NO_ACCESSIBILITY if (event->type() == QAccessible::TableModelChanged) { - if (QAccessibleInterface *iface = event->accessibleInterface()) { - if (iface->tableInterface()) - iface->tableInterface()->modelChange(static_cast<QAccessibleTableModelChangeEvent*>(event)); - } + QAccessibleInterface *iface = event->accessibleInterface(); + if (iface && iface->tableInterface()) + iface->tableInterface()->modelChange(static_cast<QAccessibleTableModelChangeEvent*>(event)); } if (updateHandler) { |