summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/uiautomation
diff options
context:
space:
mode:
authorAndre de la Rocha <andre.rocha@qt.io>2019-11-07 16:52:10 +0100
committerAndre de la Rocha <andre.rocha@qt.io>2019-11-07 17:40:12 +0100
commit26f8adb1eefd1a8822413e036f2878b8cc1e7029 (patch)
tree95036b83ebc4835a3f64309dbfd8e1a4d1c33f02 /src/plugins/platforms/windows/uiautomation
parentef54abae43db79792b40dfdca30ac0fa1b582354 (diff)
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>
Diffstat (limited to 'src/plugins/platforms/windows/uiautomation')
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp
index 5a05adbf81..96d64acc32 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp
@@ -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).