Skip to content

Commit

Permalink
Send accessibility updates for the right item.
Browse files Browse the repository at this point in the history
Child 0 means the first child.
The index needs to be -1 which the default ctor does.

Change-Id: I71fbdf5a15dd4593178cb250f06d42f601e40d4d
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
  • Loading branch information
Frederik Gladhorn authored and Qt by Nokia committed Mar 13, 2012
1 parent a920803 commit b262e81
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/quick/items/qquickaccessibleattached.cpp
Expand Up @@ -144,7 +144,7 @@ QQuickAccessibleAttached::QQuickAccessibleAttached(QObject *parent)
// Enable accessibility for items with accessible content. This also
// enables accessibility for the ancestors of souch items.
item->d_func()->setAccessibleFlagAndListener();
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectCreated, item, 0));
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectCreated, item));
}

QQuickAccessibleAttached::~QQuickAccessibleAttached()
Expand Down
4 changes: 2 additions & 2 deletions src/quick/items/qquickaccessibleattached_p.h
Expand Up @@ -85,7 +85,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickAccessibleAttached : public QObject
if (name != m_name) {
m_name = name;
emit nameChanged();
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, parent(), 0));
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, parent()));
}
}

Expand All @@ -95,7 +95,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickAccessibleAttached : public QObject
if (m_description != description) {
m_description = description;
emit descriptionChanged();
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DescriptionChanged, parent(), 0));
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DescriptionChanged, parent()));
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/quick/items/qquickitem.cpp
Expand Up @@ -3018,7 +3018,7 @@ void QQuickItem::inputMethodEvent(QInputMethodEvent *event)

void QQuickItem::focusInEvent(QFocusEvent *)
{
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, this, 0));
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, this));
}

void QQuickItem::focusOutEvent(QFocusEvent *)
Expand Down Expand Up @@ -3984,7 +3984,7 @@ bool QQuickItemPrivate::setEffectiveVisibleRecur(bool newEffectiveVisible)
itemChange(QQuickItem::ItemVisibleHasChanged, effectiveVisible);

if (isAccessible)
QAccessible::updateAccessibility(QAccessibleEvent(effectiveVisible ? QAccessible::ObjectShow : QAccessible::ObjectHide, q, 0));
QAccessible::updateAccessibility(QAccessibleEvent(effectiveVisible ? QAccessible::ObjectShow : QAccessible::ObjectHide, q));

emit q->visibleChanged();
if (childVisibilityChanged)
Expand Down
4 changes: 2 additions & 2 deletions src/quick/items/qquicktextinput.cpp
Expand Up @@ -3265,7 +3265,7 @@ void QQuickTextInputPrivate::internalSetText(const QString &txt, int pos, bool e
Q_UNUSED(changed)
#else
if (changed)
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TextUpdated, q, 0));
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TextUpdated, q));
#endif
}

Expand Down Expand Up @@ -3891,7 +3891,7 @@ bool QQuickTextInputPrivate::emitCursorPositionChanged()
}

#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TextCaretMoved, q, 0));
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TextCaretMoved, q));
#endif

return true;
Expand Down

0 comments on commit b262e81

Please sign in to comment.