diff options
author | Morten Johan Sorvig <morten.sorvig@nokia.com> | 2012-01-19 07:49:48 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-23 14:47:10 +0100 |
commit | 95ea9cb1914b7307e1d832c7813f944f12e463b5 (patch) | |
tree | 5936ebb04a31ffece250b5a57cb3614e5561f7e2 /src/plugins/platforms/cocoa/qnsviewaccessibility.mm | |
parent | 7ed6a247bfcf314b4a7bc8332b813b3e92997e41 (diff) |
Use QObject pointer as QCocoaAccessibleElement id.
Each QCocoaAccessibleElement needs to provide a
unique stable id through the -(NSUnterger)hash
method.
The previous approach of basing the hash on the parent
hash plus the child index is unpractical now that
childAt() can return distant descendants instead
of immediate children only. Use the QObject pointer,
which is set for all accessible interfaces today.
Change-Id: I5868e3a81c1b4da7233504f30003ab8060e9fa3f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsviewaccessibility.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsviewaccessibility.mm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm index 3c16973c5a..854d292b09 100644 --- a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm +++ b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm @@ -75,7 +75,7 @@ int numKids = m_accessibleRoot->childCount(); NSMutableArray *kids = [NSMutableArray arrayWithCapacity:numKids]; for (int i = 0; i < numKids; ++i) { - [kids addObject:[QCocoaAccessibleElement elementWithIndex:i parent:self accessibleInterface:(void*)m_accessibleRoot->child(i)]]; + [kids addObject:[QCocoaAccessibleElement elementWithInterface: m_accessibleRoot->child(i) parent:self ]]; } return NSAccessibilityUnignoredChildren(kids); @@ -96,8 +96,8 @@ } // Hit a child, forward to child accessible interface. - int childIndex = m_accessibleRoot->indexOfChild(childInterface); - QCocoaAccessibleElement *accessibleElement = [QCocoaAccessibleElement elementWithIndex:childIndex -1 parent:self accessibleInterface: childInterface]; + + QCocoaAccessibleElement *accessibleElement = [QCocoaAccessibleElement elementWithInterface: childInterface parent:self ]; return [accessibleElement accessibilityHitTest:point]; } |