Windows QPA: Avoid returning UI Automation ValueProvider for static text

Static text controls should not return a ValueProvider. Otherwise,
Narrator reads out static texts and announces whether they are
editable or not, which is confusing to users. It should only read
out the text itself.

Fixes: QTBUG-79613
Change-Id: I080cd6a5db10f6f673b50c40ac7d87c3737d9b55
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Andre de la Rocha 2019-11-07 16:52:10 +01:00
parent ef54abae43
commit 26f8adb1ee

View File

@ -277,8 +277,9 @@ HRESULT QWindowsUiaMainProvider::GetPatternProvider(PATTERNID idPattern, IUnknow
}
break;
case UIA_ValuePatternId:
// All accessible controls return text(QAccessible::Value) (which may be empty).
*pRetVal = new QWindowsUiaValueProvider(id());
// All non-static controls support the Value pattern.
if (accessible->role() != QAccessible::StaticText)
*pRetVal = new QWindowsUiaValueProvider(id());
break;
case UIA_RangeValuePatternId:
// Controls providing a numeric value within a range (e.g., sliders, scroll bars, dials).