Accessibility: Do not assert when a widget doesn't have a QAI

[ChangeLog][QtGui] Fixed crash when sending accessibility updates when
the corresponding widget does not have a corresponding
QAccessibleInterface. This showed on Mac for example with QStatusBar.

Task-number: QTBUG-35421
Change-Id: I94174e98e858b7a0122532ee5fcc8458a263bccd
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
This commit is contained in:
Frederik Gladhorn 2013-12-10 15:47:46 +01:00 committed by The Qt Project
parent 631c3dbc80
commit 97c1b2d32e

View File

@ -1313,6 +1313,8 @@ QAccessible::Id QAccessibleEvent::uniqueId() const
if (!m_object) if (!m_object)
return m_uniqueId; return m_uniqueId;
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(m_object); QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(m_object);
if (!iface)
return 0;
if (m_child != -1) if (m_child != -1)
iface = iface->child(m_child); iface = iface->child(m_child);
return QAccessible::uniqueId(iface); return QAccessible::uniqueId(iface);