Commit ee9c5f72 authored by Jan-Arve Saether's avatar Jan-Arve Saether Committed by Qt by Nokia
Browse files

Remove QAccessible::FocusChild, add focusChild()


Change-Id: Idc96d91ec31630b4240fe473ed3b4bf0a4753618
Reviewed-by: default avatarFrederik Gladhorn <frederik.gladhorn@nokia.com>
parent 52b77f94
No related merge requests found
Showing with 18 additions and 23 deletions
...@@ -119,37 +119,30 @@ QAccessibleInterface *QAccessibleDeclarativeItem::child(int index) const ...@@ -119,37 +119,30 @@ QAccessibleInterface *QAccessibleDeclarativeItem::child(int index) const
int QAccessibleDeclarativeItem::navigate(QAccessible::RelationFlag rel, int entry, QAccessibleInterface **target) const int QAccessibleDeclarativeItem::navigate(QAccessible::RelationFlag rel, int entry, QAccessibleInterface **target) const
{ {
//qDebug() << "QAccessibleDeclarativeItem navigate" << rel << entry; Q_UNUSED(rel);
Q_ASSERT(entry >= 0); Q_UNUSED(entry);
*target = 0; *target = 0;
if (entry == 0) { return -1;
*target = new QAccessibleDeclarativeItem(m_item->toGraphicsObject(), m_view); }
return 0;
}
switch (rel) { /*! \reimp */
case QAccessible::FocusChild: { QAccessibleInterface *QAccessibleDeclarativeItem::focusChild() const
QGraphicsObject *focusObject = 0; {
if (m_item->hasFocus()) { QGraphicsObject *focusObject = 0;
focusObject = m_item->toGraphicsObject(); if (m_item->hasFocus()) {
} else { focusObject = m_item->toGraphicsObject();
if (QGraphicsItem *focusItem = m_view->scene()->focusItem()) { } else {
if (QGraphicsScene *scene = m_view->scene()) {
if (QGraphicsItem *focusItem = scene->focusItem()) {
if (m_item->isAncestorOf(focusItem)) { if (m_item->isAncestorOf(focusItem)) {
focusObject = focusItem->toGraphicsObject(); focusObject = focusItem->toGraphicsObject();
} }
} }
} }
//qDebug() << "QAccessibleDeclarativeItem navigate QAccessible::FocusChild" << rel << entry;
if (focusObject) {
*target = new QAccessibleDeclarativeItem(focusObject, m_view);
return 0;
}
}
default: break;
} }
if (focusObject)
return -1; return new QAccessibleDeclarativeItem(focusObject, m_view); //###queryAccessibleInterface?
return 0;
} }
int QAccessibleDeclarativeItem::indexOfChild(const QAccessibleInterface *iface) const int QAccessibleDeclarativeItem::indexOfChild(const QAccessibleInterface *iface) const
......
...@@ -59,6 +59,8 @@ public: ...@@ -59,6 +59,8 @@ public:
bool clipsChildren() const; bool clipsChildren() const;
QAccessibleInterface *focusChild() const;
QAccessibleInterface *parent() const; QAccessibleInterface *parent() const;
QAccessibleInterface *child(int index) const; QAccessibleInterface *child(int index) const;
int childCount() const; int childCount() const;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment