From b209270825cc2c3345d094e3dd547604c64e0b26 Mon Sep 17 00:00:00 2001 From: Andre de la Rocha Date: Fri, 6 Dec 2019 20:21:41 +0100 Subject: Windows QPA: Export "checkable" info for menu items through UI Automation In order to allow screen readers to say checked/unchecked for checkable menu items, this information has to be provided through UI Automation. Checkable menu items should implement the "Toggle" UI Automation pattern. The "checkable" state must also be supported by QAccessibleMenuItem, which is being added by a separated change. Task-number: QTBUG-80551 Change-Id: I661668310d1b6b4701d0c0efdb1dcfd15d0db729 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp index e5a9f275ae..cc293b777c 100644 --- a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp +++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp @@ -289,7 +289,8 @@ HRESULT QWindowsUiaMainProvider::GetPatternProvider(PATTERNID idPattern, IUnknow break; case UIA_TogglePatternId: // Checkbox controls. - if (accessible->role() == QAccessible::CheckBox) { + if (accessible->role() == QAccessible::CheckBox + || (accessible->role() == QAccessible::MenuItem && accessible->state().checkable)) { *pRetVal = new QWindowsUiaToggleProvider(id()); } break; -- cgit v1.2.3