}
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()) {
}
return -1;
-
}
int QAccessibleDeclarativeItem::indexOfChild(const QAccessibleInterface *iface) 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
}
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;
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;
}
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