summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp
diff options
context:
space:
mode:
authorAndre de la Rocha <andre.rocha@qt.io>2020-04-29 17:07:24 +0200
committerAndré de la Rocha <andre.rocha@qt.io>2020-05-10 01:33:05 +0000
commita77b19a911c4d6c47c185a8e59ebbcec8b14bcca (patch)
treeb78d0fbaf6e6e11dd2712501e2bb2b84a02ee897 /src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp
parentc54279a1ad521373a5cd5f579b4a1f5e50e64f2d (diff)
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 <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp')
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp13
1 files changed, 13 insertions, 0 deletions
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()) {