Accessibility Mac: Implement value interface
Change-Id: Iea6e3c69b220d35bddb1798ff991f8e67e1749e3 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>bb10
parent
65866bcff5
commit
581d3adb2b
|
|
@ -65,12 +65,14 @@ void QCococaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
|
|||
return;
|
||||
|
||||
switch (event->type()) {
|
||||
case QAccessible::ValueChanged:
|
||||
case QAccessible::TextInserted :
|
||||
case QAccessible::TextRemoved :
|
||||
case QAccessible::TextUpdated : {
|
||||
QCocoaAccessibleElement *element = [QCocoaAccessibleElement elementWithInterface : interface parent : nil];
|
||||
NSAccessibilityPostNotification(element, NSAccessibilityValueChangedNotification);
|
||||
break; }
|
||||
|
||||
default:
|
||||
delete interface;
|
||||
break;
|
||||
|
|
@ -273,7 +275,8 @@ QString translateAction(NSString *nsAction)
|
|||
bool hasValueAttribute(QAccessibleInterface *interface)
|
||||
{
|
||||
const QAccessible::Role qtrole = interface->role();
|
||||
if (qtrole == QAccessible::EditableText) {
|
||||
if (qtrole == QAccessible::EditableText
|
||||
|| interface->valueInterface()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -301,6 +304,10 @@ id getValueAttribute(QAccessibleInterface *interface)
|
|||
}
|
||||
}
|
||||
|
||||
if (QAccessibleValueInterface *valueInterface = interface->valueInterface()) {
|
||||
return QCFString::toNSString(QString::number(valueInterface->currentValue().toDouble()));
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue