Accessibility Mac: implement min/max value
This commit fixes QProgressBar reading by VoiceOver. Task-number: QTBUG-38272 Change-Id: I549fbebe1aff599e53b14685c1bde6c9fb98aa21 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
This commit is contained in:
parent
8abf98345a
commit
57f8fba4cb
@ -168,6 +168,14 @@
|
|||||||
// TODO: multi-selection: NSAccessibilitySelectedTextRangesAttribute,
|
// TODO: multi-selection: NSAccessibilitySelectedTextRangesAttribute,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (iface->valueInterface()) {
|
||||||
|
[attributes addObjectsFromArray: [[NSArray alloc] initWithObjects:
|
||||||
|
NSAccessibilityMinValueAttribute,
|
||||||
|
NSAccessibilityMaxValueAttribute,
|
||||||
|
nil
|
||||||
|
]];
|
||||||
|
}
|
||||||
|
|
||||||
return [attributes autorelease];
|
return [attributes autorelease];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,6 +199,19 @@
|
|||||||
return [QCocoaAccessibleElement elementWithId: parentId];
|
return [QCocoaAccessibleElement elementWithId: parentId];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (id) minValueAttribute:(QAccessibleInterface*)iface {
|
||||||
|
if (QAccessibleValueInterface *val = iface->valueInterface())
|
||||||
|
return [NSNumber numberWithDouble: val->minimumValue().toDouble()];
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) maxValueAttribute:(QAccessibleInterface*)iface {
|
||||||
|
if (QAccessibleValueInterface *val = iface->valueInterface())
|
||||||
|
return [NSNumber numberWithDouble: val->maximumValue().toDouble()];
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
- (id)accessibilityAttributeValue:(NSString *)attribute {
|
- (id)accessibilityAttributeValue:(NSString *)attribute {
|
||||||
QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
|
QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
|
||||||
if (!iface) {
|
if (!iface) {
|
||||||
@ -272,6 +293,10 @@
|
|||||||
return [NSNumber numberWithInt: textBeforeCursor.count(QLatin1Char('\n'))];
|
return [NSNumber numberWithInt: textBeforeCursor.count(QLatin1Char('\n'))];
|
||||||
}
|
}
|
||||||
return nil;
|
return nil;
|
||||||
|
} else if ([attribute isEqualToString:NSAccessibilityMinValueAttribute]) {
|
||||||
|
return [self minValueAttribute:iface];
|
||||||
|
} else if ([attribute isEqualToString:NSAccessibilityMaxValueAttribute]) {
|
||||||
|
return [self maxValueAttribute:iface];
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil;
|
return nil;
|
||||||
|
Loading…
Reference in New Issue
Block a user