summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
index 830e6860b7..ceb60faf41 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
@@ -195,11 +195,12 @@ static QAccessibleInterface *acast(void *ptr)
- (NSString *)accessibilityActionDescription:(NSString *)action {
QAccessibleActionInterface *actionInterface = acast(accessibleInterface)->actionInterface();
- if (actionInterface) {
- QString qtAction = QCocoaAccessible::translateAction(action);
+ QString qtAction = QCocoaAccessible::translateAction(action);
+
+ // Return a description from the action interface if this action is not known to the OS.
+ if (qtAction.isEmpty()) {
QString description = actionInterface->localizedActionDescription(qtAction);
- if (!description.isEmpty())
- return qt_mac_QStringToNSString(description);
+ return qt_mac_QStringToNSString(description);
}
return NSAccessibilityActionDescription(action);