iOS: Accessibility: Don't cut off the last character from the text value

The second parameter is the position of the first character not to be
returned when calling text(). So it needs to be passed the length of
the text, otherwise the last character is cut off.

Task-number: QTBUG-93494
Pick-to: 6.1 5.15 5.12
Change-Id: I7dd8324b3939220de125ba819b7b77588b21bd4b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Andy Shaw 2021-05-07 13:25:42 +02:00
parent 688602704d
commit 5c29f981fa

View File

@ -123,8 +123,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QMacAccessibilityElement);
if (val) { if (val) {
return val->currentValue().toString().toNSString(); return val->currentValue().toString().toNSString();
} else if (QAccessibleTextInterface *text = iface->textInterface()) { } else if (QAccessibleTextInterface *text = iface->textInterface()) {
// FIXME doesn't work? return text->text(0, text->characterCount()).toNSString();
return text->text(0, text->characterCount() - 1).toNSString();
} }
return [super accessibilityHint]; return [super accessibilityHint];