From 96d69b0fe409de354d369489a284677c30378787 Mon Sep 17 00:00:00 2001 From: Jan-Arve Saether Date: Thu, 19 Jan 2012 12:01:55 +0100 Subject: [PATCH] Use queryAccessibleInterface instead of new QAccessibleQuickItem MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/plugins/accessible/quick/qaccessiblequickitem.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/plugins/accessible/quick/qaccessiblequickitem.cpp b/src/plugins/accessible/quick/qaccessiblequickitem.cpp index fd087c4..b2c1098 100644 --- a/src/plugins/accessible/quick/qaccessiblequickitem.cpp +++ b/src/plugins/accessible/quick/qaccessiblequickitem.cpp @@ -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; @@ -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 @@ -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; } -- 2.7.4