Skip to content

Commit

Permalink
Accessibility: Use new updateAccessibility() API in declarative.
Browse files Browse the repository at this point in the history
Change-Id: I7ab5c767c9d21c9cad1ee7f7c1f6e21ed4dccef3
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
  • Loading branch information
Friedemann Kleint authored and Qt by Nokia committed Feb 1, 2012
1 parent a83dafe commit ae6acb4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Expand Up @@ -59,7 +59,7 @@ QDeclarativeAccessibleAttached::QDeclarativeAccessibleAttached(QObject *parent)
// Enable accessibility for items with accessible content. This also
// enables accessibility for the ancestors of such items.
item->d_func()->setAccessibleFlagAndListener();
QAccessible::updateAccessibility(item, 0, QAccessible::ObjectCreated);
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectCreated, item, 0));
}

QDeclarativeAccessibleAttached::~QDeclarativeAccessibleAttached()
Expand Down
4 changes: 2 additions & 2 deletions src/qtquick1/graphicsitems/qdeclarativeaccessibleattached_p.h
Expand Up @@ -83,15 +83,15 @@ class Q_QTQUICK1_EXPORT QDeclarativeAccessibleAttached : public QObject
{
m_name = name;
emit nameChanged();
QAccessible::updateAccessibility(parent(), 0, QAccessible::NameChanged);
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, parent(), 0));
}

QString description() const { return m_description; }
void setDescription(const QString &description)
{
m_description = description;
emit descriptionChanged();
QAccessible::updateAccessibility(parent(), 0, QAccessible::DescriptionChanged);
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DescriptionChanged, parent(), 0));
}

// Factory function
Expand Down
2 changes: 1 addition & 1 deletion src/quick/items/qquickaccessibleattached.cpp
Expand Up @@ -148,7 +148,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(item, 0, QAccessible::ObjectCreated);
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectCreated, item, 0));
}

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(parent(), 0, QAccessible::NameChanged);
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, parent(), 0));
}
}

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(parent(), 0, QAccessible::DescriptionChanged);
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DescriptionChanged, parent(), 0));
}
}

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

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

void QQuickItem::focusOutEvent(QFocusEvent *)
Expand Down Expand Up @@ -3950,7 +3950,7 @@ void QQuickItemPrivate::setEffectiveVisibleRecur(bool newEffectiveVisible)
}

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

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

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

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

return true;
Expand Down

0 comments on commit ae6acb4

Please sign in to comment.