From a77b19a911c4d6c47c185a8e59ebbcec8b14bcca Mon Sep 17 00:00:00 2001 From: Andre de la Rocha Date: Wed, 29 Apr 2020 17:07:24 +0200 Subject: Windows QPA: Fix missing accessible name change events Accessible name change events were not being relayed through UI Automation. This caused changes in the state of combo boxes and possibly other quick controls to be missed by UI Automation clients. This would result, for instance, in Narrator not reading the state of a combo box when its current index was changed with the keyboard. Fixes: QTBUG-70621 Pick-to: 5.15 Change-Id: I16de0ff2bb0fb5227111d5347c25f442e9b0a533 Reviewed-by: Friedemann Kleint Reviewed-by: Oliver Wolff --- .../windows/uiautomation/qwindowsuiamainprovider.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp') diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp index 3962d2d27f..9808d5481c 100644 --- a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp +++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp @@ -200,6 +200,19 @@ void QWindowsUiaMainProvider::notifyValueChange(QAccessibleValueChangeEvent *eve } } +void QWindowsUiaMainProvider::notifyNameChange(QAccessibleEvent *event) +{ + if (QAccessibleInterface *accessible = event->accessibleInterface()) { + if (QWindowsUiaMainProvider *provider = providerForAccessible(accessible)) { + VARIANT oldVal, newVal; + clearVariant(&oldVal); + setVariantString(accessible->text(QAccessible::Name), &newVal); + QWindowsUiaWrapper::instance()->raiseAutomationPropertyChangedEvent(provider, UIA_NamePropertyId, oldVal, newVal); + ::SysFreeString(newVal.bstrVal); + } + } +} + void QWindowsUiaMainProvider::notifySelectionChange(QAccessibleEvent *event) { if (QAccessibleInterface *accessible = event->accessibleInterface()) { -- cgit v1.2.3