Accessibility Mac: Enable ignoring of children
The ignored children do not show up in the hierarchy, this should improve performance significantly. Previously the code would ignore the grouping property which seems to break QGroupBox. Change-Id: I4535af9c95bce76ded65f6d40fe07f17f3acffad Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>bb10
parent
6300caf01f
commit
ae6f9d00a6
|
|
@ -180,7 +180,8 @@ bool shouldBeIgnored(QAccessibleInterface *interface)
|
|||
// state. Ignore interfaces with those flags set.
|
||||
const QAccessible::State state = interface->state();
|
||||
if (state.invisible ||
|
||||
state.offscreen)
|
||||
state.offscreen ||
|
||||
state.invalid)
|
||||
return true;
|
||||
|
||||
// Some roles are not interesting. In particular, container roles should be
|
||||
|
|
@ -189,12 +190,13 @@ bool shouldBeIgnored(QAccessibleInterface *interface)
|
|||
if (role == QAccessible::Border || // QFrame
|
||||
role == QAccessible::Application || // We use the system-provided application element.
|
||||
role == QAccessible::MenuItem || // The system also provides the menu items.
|
||||
role == QAccessible::ToolBar) // Access the tool buttons directly.
|
||||
role == QAccessible::ToolBar || // Access the tool buttons directly.
|
||||
role == QAccessible::Pane || // Scroll areas.
|
||||
role == QAccessible::Client) // The default for QWidget.
|
||||
return true;
|
||||
|
||||
NSString *mac_role = macRole(interface);
|
||||
if (mac_role == NSAccessibilityWindowRole || // We use the system-provided window elements.
|
||||
mac_role == NSAccessibilityGroupRole ||
|
||||
mac_role == NSAccessibilityUnknownRole)
|
||||
return true;
|
||||
|
||||
|
|
|
|||
|
|
@ -151,6 +151,7 @@
|
|||
[kids addObject: element];
|
||||
[element release];
|
||||
}
|
||||
// ### maybe we should use NSAccessibilityUnignoredChildren(kids); this needs more profiling
|
||||
return kids;
|
||||
|
||||
} else if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) {
|
||||
|
|
@ -256,7 +257,7 @@
|
|||
// misc
|
||||
|
||||
- (BOOL)accessibilityIsIgnored {
|
||||
return false; //QCocoaAccessible::shouldBeIgnored(QAccessible::accessibleInterface(id));
|
||||
return QCocoaAccessible::shouldBeIgnored(QAccessible::accessibleInterface(axid));
|
||||
}
|
||||
|
||||
- (id)accessibilityHitTest:(NSPoint)point {
|
||||
|
|
|
|||
Loading…
Reference in New Issue