Windows QPA: Enable Toggle UIA pattern for all checkable controls

This change allows the checked/unchecked state to be detected by screen
readers for all controls with a checkable state.

Task-number: QTBUG-81919
Change-Id: I604151397b4ae21297009c274ffe634723ebe783
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Andre de la Rocha 2020-03-25 06:01:34 +01:00
parent c91b7f15ce
commit 319ac188eb

View File

@ -305,11 +305,9 @@ HRESULT QWindowsUiaMainProvider::GetPatternProvider(PATTERNID idPattern, IUnknow
} }
break; break;
case UIA_TogglePatternId: case UIA_TogglePatternId:
// Checkbox controls. // Checkboxes and other checkable controls.
if (accessible->role() == QAccessible::CheckBox if (accessible->state().checkable)
|| (accessible->role() == QAccessible::MenuItem && accessible->state().checkable)) {
*pRetVal = new QWindowsUiaToggleProvider(id()); *pRetVal = new QWindowsUiaToggleProvider(id());
}
break; break;
case UIA_SelectionPatternId: case UIA_SelectionPatternId:
// Lists of items. // Lists of items.