Skip to content

Commit

Permalink
Use queryAccessibleInterface instead of new QAccessibleQuickItem
Browse files Browse the repository at this point in the history
In some cases this could prevent us from actually returning the
expected QAccessibleQuickItemValueInterface.
This is also more future-proof in case we add more QAI subclasses.

Change-Id: Id66dc21418671a3045d93c0a44dc74aa0aff30af
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
  • Loading branch information
Jan-Arve Saether authored and Qt by Nokia committed Jan 20, 2012
1 parent 126ada1 commit 96d69b0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/plugins/accessible/quick/qaccessiblequickitem.cpp
Expand Up @@ -98,8 +98,7 @@ QAccessibleInterface *QAccessibleQuickItem::parent() const
if (parent == canvas->rootItem()) {
return QAccessible::queryAccessibleInterface(canvas);
} else {
QDeclarativeAccessible *ancestor = new QAccessibleQuickItem(parent);
return ancestor;
return QAccessible::queryAccessibleInterface(parent);
}
}
return 0;
Expand All @@ -116,7 +115,7 @@ QAccessibleInterface *QAccessibleQuickItem::child(int index) const
if (!child) // FIXME can this happen?
return 0;

return new QAccessibleQuickItem(child);
return QAccessible::queryAccessibleInterface(child);
}

int QAccessibleQuickItem::navigate(QAccessible::RelationFlag rel, int entry, QAccessibleInterface **target) const
Expand All @@ -125,10 +124,6 @@ int QAccessibleQuickItem::navigate(QAccessible::RelationFlag rel, int entry, QAc
Q_UNUSED(entry);
Q_UNUSED(target);
*target = 0;
if (entry == 0) {
*target = new QAccessibleQuickItem(item());
return 0;
}
return -1;
}

Expand Down

0 comments on commit 96d69b0

Please sign in to comment.