aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorJan-Arve Saether <jan-arve.saether@nokia.com>2012-01-05 14:37:29 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-05 16:31:56 +0100
commitc831c9f5166982d86f6cd82ed438df7cc9b3f8e3 (patch)
treee8ba70b6d41b6467d4a6a83857fee62654e9128b /src/plugins
parent4e9efd590df116bad85632d32ac4fed0a1c29065 (diff)
Remove all references to QAccessible:: {Child|Ancestor|Sibling}
These are deprecated in favor of QAccessibleInterface::child() and QAccessibleInterface::parent() QAccessible::Sibling can be done with a combination of those two. This is handled by the bridge Change-Id: Ie63d74314189d9e0f24f1152a2f0030d9e865b75 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/accessible/qtquick1/qaccessibledeclarativeitem.cpp45
-rw-r--r--src/plugins/accessible/qtquick1/qaccessibledeclarativeview.cpp11
-rw-r--r--src/plugins/accessible/qtquick1/qaccessibledeclarativeview.h1
-rw-r--r--src/plugins/accessible/quick/qaccessiblequickitem.cpp47
-rw-r--r--src/plugins/accessible/quick/qaccessiblequickview.cpp13
5 files changed, 9 insertions, 108 deletions
diff --git a/src/plugins/accessible/qtquick1/qaccessibledeclarativeitem.cpp b/src/plugins/accessible/qtquick1/qaccessibledeclarativeitem.cpp
index 2d4572a54f..6e4f27adb2 100644
--- a/src/plugins/accessible/qtquick1/qaccessibledeclarativeitem.cpp
+++ b/src/plugins/accessible/qtquick1/qaccessibledeclarativeitem.cpp
@@ -129,50 +129,6 @@ int QAccessibleDeclarativeItem::navigate(QAccessible::RelationFlag rel, int entr
}
switch (rel) {
- case QAccessible::Child: {
- QList<QGraphicsItem *> children = m_item->childItems();
- const int childIndex = entry - 1;
-
- if (childIndex >= children.count())
- return -1;
-
- QGraphicsItem *child = children.at(childIndex);
- QGraphicsObject *childObject = qobject_cast<QGraphicsObject *>(child);
- if (!childObject)
- return -1;
-
- *target = new QAccessibleDeclarativeItem(childObject, m_view);
- return 0;
- break;}
- case QAccessible::Ancestor: {
- Q_ASSERT(entry >= 1);
- QGraphicsItem *parent = m_item->parentItem();
- QGraphicsObject *parentObj = parent ? parent->toGraphicsObject() : 0;
- if (parent && !parentObj)
- qWarning("Can not make QGraphicsItems accessible");
- QAccessibleInterface *ancestor = (parentObj
- ? new QAccessibleDeclarativeItem(parentObj, m_view)
- : QAccessible::queryAccessibleInterface(m_view));
- if (entry == 1) {
- *target = ancestor;
- return 0;
- } else if (entry > 1) {
- int ret = ancestor->navigate(QAccessible::Ancestor, entry - 1, target);
- delete ancestor;
- return ret;
- }
- break;}
- case QAccessible::Sibling: {
- QAccessibleInterface *iface = 0;
- if (navigate(QAccessible::Ancestor, 1, &iface) == 0) {
- if (iface) {
- int ret = iface->navigate(QAccessible::Child, entry, target);
- delete iface;
- return ret;
- }
- }
- return -1;
- break;}
case QAccessible::FocusChild: {
QGraphicsObject *focusObject = 0;
if (m_item->hasFocus()) {
@@ -194,7 +150,6 @@ int QAccessibleDeclarativeItem::navigate(QAccessible::RelationFlag rel, int entr
}
return -1;
-
}
int QAccessibleDeclarativeItem::indexOfChild(const QAccessibleInterface *iface) const
diff --git a/src/plugins/accessible/qtquick1/qaccessibledeclarativeview.cpp b/src/plugins/accessible/qtquick1/qaccessibledeclarativeview.cpp
index 50e7271274..25034a2532 100644
--- a/src/plugins/accessible/qtquick1/qaccessibledeclarativeview.cpp
+++ b/src/plugins/accessible/qtquick1/qaccessibledeclarativeview.cpp
@@ -68,17 +68,10 @@ QAccessibleInterface *QAccessibleDeclarativeView::child(int index) const
return 0;
}
-int QAccessibleDeclarativeView::navigate(QAccessible::RelationFlag rel, int entry, QAccessibleInterface **target) const
-{
- if (rel == QAccessible::Child) {
- *target = child(entry - 1);
- return *target ? 0 : -1;
- }
- return QAccessibleWidget::navigate(rel, entry, target);
-}
-
QAccessibleInterface *QAccessibleDeclarativeView::childAt(int x, int y) const
{
+ Q_UNUSED(x);
+ Q_UNUSED(y);
return child(0); // return the top-level QML item
}
diff --git a/src/plugins/accessible/qtquick1/qaccessibledeclarativeview.h b/src/plugins/accessible/qtquick1/qaccessibledeclarativeview.h
index e230784d5c..a77a49d96d 100644
--- a/src/plugins/accessible/qtquick1/qaccessibledeclarativeview.h
+++ b/src/plugins/accessible/qtquick1/qaccessibledeclarativeview.h
@@ -60,7 +60,6 @@ public:
QAccessibleInterface *child(int index) const;
int childCount() const;
- int navigate(QAccessible::RelationFlag rel, int entry, QAccessibleInterface **target) const;
QAccessibleInterface *childAt(int x, int y) const;
int indexOfChild(const QAccessibleInterface *iface) const;
diff --git a/src/plugins/accessible/quick/qaccessiblequickitem.cpp b/src/plugins/accessible/quick/qaccessiblequickitem.cpp
index c502a8a8e3..49b51f235b 100644
--- a/src/plugins/accessible/quick/qaccessiblequickitem.cpp
+++ b/src/plugins/accessible/quick/qaccessiblequickitem.cpp
@@ -141,55 +141,14 @@ QAccessibleInterface *QAccessibleQuickItem::child(int index) const
int QAccessibleQuickItem::navigate(QAccessible::RelationFlag rel, int entry, QAccessibleInterface **target) const
{
+ Q_UNUSED(rel);
+ Q_UNUSED(entry);
+ Q_UNUSED(target);
*target = 0;
if (entry == 0) {
*target = new QAccessibleQuickItem(m_item);
return 0;
}
-
- switch (rel) {
- case QAccessible::Child: { // FIMXE
- QList<QQuickItem *> children = childItems();
- const int childIndex = entry - 1;
-
- if (childIndex >= children.count())
- return -1;
-
- QQuickItem *child = children.at(childIndex);
- if (!child)
- return -1;
-
- *target = new QAccessibleQuickItem(child);
- return 0;
- break;}
- case QAccessible::Ancestor: { // FIMXE
- QQuickItem *parent = m_item->parentItem();
- if (parent) {
- QDeclarativeAccessible *ancestor = new QAccessibleQuickItem(parent);
- if (entry == 1) {
- QQuickCanvas *canvas = m_item->canvas();
- // Jump out to the scene widget if the parent is the root item.
- // There are two root items, QQuickCanvas::rootItem and
- // QQuickView::declarativeRoot. The former is the true root item,
- // but is not a part of the accessibility tree. Check if we hit
- // it here and return an interface for the scene instead.
- if (parent == canvas->rootItem()) {
- *target = QAccessible::queryAccessibleInterface(canvas);
- } else {
- *target = ancestor;
- }
- return 0;
- } else if (entry > 1) {
- int ret = ancestor->navigate(QAccessible::Ancestor, entry - 1, target);
- delete ancestor;
- return ret;
- }
- }
- return -1;
- break;}
- default: break;
- }
-
return -1;
}
diff --git a/src/plugins/accessible/quick/qaccessiblequickview.cpp b/src/plugins/accessible/quick/qaccessiblequickview.cpp
index 55943c92fa..65e7e18bca 100644
--- a/src/plugins/accessible/quick/qaccessiblequickview.cpp
+++ b/src/plugins/accessible/quick/qaccessiblequickview.cpp
@@ -93,15 +93,10 @@ QRect QAccessibleQuickView::rect() const
int QAccessibleQuickView::navigate(QAccessible::RelationFlag rel, int entry, QAccessibleInterface **target) const
{
- switch (rel) {
- case QAccessible::Child:
- *target = child(entry - 1);
- case QAccessible::Ancestor:
- *target = parent();
- default:
- *target = 0;
- }
- return *target ? 0 : -1;
+ Q_UNUSED(rel);
+ Q_UNUSED(entry);
+ Q_UNUSED(target);
+ return -1;
}
QString QAccessibleQuickView::text(QAccessible::Text text) const