Re-add all accessibility updates with new api.
Change-Id: Iec91c41a0137911ccf6e9f4fa907a378d9dd335a
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
// Enable accessibility for items with accessible content. This also
// enables accessibility for the ancestors of souch items.
item->d_func()->setAccessibleFlagAndListener();
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessibleEvent ev(item, QAccessible::ObjectCreated);
+ QAccessible::updateAccessibility(&ev);
+#endif
}
QQuickAccessibleAttached::~QQuickAccessibleAttached()
if (name != m_name) {
m_name = name;
emit nameChanged();
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessibleEvent ev(parent(), QAccessible::NameChanged);
+ QAccessible::updateAccessibility(&ev);
+#endif
}
}
if (m_description != description) {
m_description = description;
emit descriptionChanged();
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessibleEvent ev(parent(), QAccessible::DescriptionChanged);
+ QAccessible::updateAccessibility(&ev);
+#endif
}
}
void QQuickItem::focusInEvent(QFocusEvent *)
{
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessibleEvent ev(this, QAccessible::Focus);
+ QAccessible::updateAccessibility(&ev);
+#endif
}
void QQuickItem::focusOutEvent(QFocusEvent *)
childVisibilityChanged |= QQuickItemPrivate::get(childItems.at(ii))->setEffectiveVisibleRecur(newEffectiveVisible);
itemChange(QQuickItem::ItemVisibleHasChanged, effectiveVisible);
-
+#ifndef QT_NO_ACCESSIBILITY
+ if (isAccessible) {
+ QAccessibleEvent ev(q, effectiveVisible ? QAccessible::ObjectShow : QAccessible::ObjectHide);
+ QAccessible::updateAccessibility(&ev);
+ }
+#endif
emit q->visibleChanged();
if (childVisibilityChanged)
emit q->visibleChildrenChanged();
*/
void QQuickTextInputPrivate::internalSetText(const QString &txt, int pos, bool edited)
{
+ Q_Q(QQuickTextInput);
internalDeselect();
QString oldText = m_text;
if (m_maskData) {
m_cursor = (pos < 0 || pos > m_text.length()) ? m_text.length() : pos;
m_textDirty = (oldText != m_text);
- finishChange(-1, true, edited);
+ bool changed = finishChange(-1, true, edited);
+#ifdef QT_NO_ACCESSIBILITY
+ Q_UNUSED(changed)
+#else
+ if (changed) {
+ QAccessibleTextUpdateEvent ev(q, 0, oldText, m_text);
+ QAccessible::updateAccessibility(&ev);
+ }
+#endif
}
}
}
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessibleTextCursorEvent ev(q, m_cursor);
+ QAccessible::updateAccessibility(&ev);
+#endif
+
return true;
}
return false;