Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove QAccessible::FocusChild, add focusChild()
Change-Id: Idc96d91ec31630b4240fe473ed3b4bf0a4753618
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
  • Loading branch information
Jan-Arve Saether authored and Qt by Nokia committed Feb 2, 2012
1 parent 52b77f9 commit ee9c5f7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
39 changes: 16 additions & 23 deletions src/plugins/accessible/qtquick1/qaccessibledeclarativeitem.cpp
Expand Up @@ -119,37 +119,30 @@ QAccessibleInterface *QAccessibleDeclarativeItem::child(int index) const

int QAccessibleDeclarativeItem::navigate(QAccessible::RelationFlag rel, int entry, QAccessibleInterface **target) const
{
//qDebug() << "QAccessibleDeclarativeItem navigate" << rel << entry;
Q_ASSERT(entry >= 0);

Q_UNUSED(rel);
Q_UNUSED(entry);
*target = 0;
if (entry == 0) {
*target = new QAccessibleDeclarativeItem(m_item->toGraphicsObject(), m_view);
return 0;
}
return -1;
}

switch (rel) {
case QAccessible::FocusChild: {
QGraphicsObject *focusObject = 0;
if (m_item->hasFocus()) {
focusObject = m_item->toGraphicsObject();
} else {
if (QGraphicsItem *focusItem = m_view->scene()->focusItem()) {
/*! \reimp */
QAccessibleInterface *QAccessibleDeclarativeItem::focusChild() const
{
QGraphicsObject *focusObject = 0;
if (m_item->hasFocus()) {
focusObject = m_item->toGraphicsObject();
} else {
if (QGraphicsScene *scene = m_view->scene()) {
if (QGraphicsItem *focusItem = scene->focusItem()) {
if (m_item->isAncestorOf(focusItem)) {
focusObject = focusItem->toGraphicsObject();
}
}
}
//qDebug() << "QAccessibleDeclarativeItem navigate QAccessible::FocusChild" << rel << entry;
if (focusObject) {
*target = new QAccessibleDeclarativeItem(focusObject, m_view);
return 0;
}
}
default: break;
}

return -1;
if (focusObject)
return new QAccessibleDeclarativeItem(focusObject, m_view); //###queryAccessibleInterface?
return 0;
}

int QAccessibleDeclarativeItem::indexOfChild(const QAccessibleInterface *iface) const
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/accessible/qtquick1/qaccessibledeclarativeitem.h
Expand Up @@ -59,6 +59,8 @@ class QAccessibleDeclarativeItem : public QDeclarativeAccessible

bool clipsChildren() const;

QAccessibleInterface *focusChild() const;

QAccessibleInterface *parent() const;
QAccessibleInterface *child(int index) const;
int childCount() const;
Expand Down

0 comments on commit ee9c5f7

Please sign in to comment.