summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qnsviewaccessibility.mm
Commit message (Collapse)AuthorAgeFilesLines
* QNSView: Harden logic around platform window accessGabriel de Dietrich2017-03-161-0/+3
| | | | | | | | | | | | | | | | | | | | Some users have reported crashes in -[QNSView mouseEnteredImpl:] which we believe are due to null m_platformWindow. The stack traces are like the one below or similar: 0 libqcocoa_dylib QNSView mouseEnteredImpl_ 0x1F 1 appkit NSTrackingArea _dispatchMouseEntered_ 0xA2 2 appkit NSApplication sendEvent_ 0xF4D 3 libqcocoa_dylib QNSApplication sendEvent_ 0x4E 4 libqcocoa_dylib QCocoaEventDispatcher processEvents 0x184 5 qtcore QEventLoop exec 0x19C 6 qtwidgets QDialog exec 0x20B Moreover, since 2f505b79a49bdf5ba8d084e13ab339bcf956c849, that member is a QPointer, so we should do more systematic checks. Change-Id: Iced447515a4ae07a62734e587f5b08d46d313071 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Remove QNSView member m_window in favor of going via m_platformWindowTor Arne Vestbø2016-10-131-2/+2
| | | | | | | | | | | The two should never be out of sync, but by having them as separate members we risk that they do. By going though m_platformWindow for QWindow access, it's also more clear in the callsites that we're dealing with a QWindow instead of a NSWindow, as referenced though self.window. Finally, removing the member slims down memory use of a QNSView, however small. Change-Id: Iec96cebf813fae82d3af339331781419f234c28b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Remove dead code.Jake Petroules2015-11-271-2/+0
| | | | | | Change-Id: Idfaef408536bafbb31444ec8728dbcf289abac8d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Fix QT_NO_ACCESSIBILITY build on OS XLiang Qi2015-09-111-0/+4
| | | | | Change-Id: Id8b41787fb9f50296ee9e0ad1f108418565d9325 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Fixed license headersJani Heikkinen2015-02-171-1/+1
| | | | | Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-22/+14
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Accessibility iOSFrederik Gladhorn2014-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | This lays the foundation for iOS accessibility. The approach is slightly different from other a11y bridges in that we completely flaten the hierarchy of wigets/quick items to a list. This works well with VoiceOver since there are comparatively few elements. The cache implementation for OS X is re-used. With this patch VoiceOver on iOS works on many applications out of the box. For now it sends the screen changed notfification somewhat overzealous, that will need revisiting and potentially new API in QAccessible. Device orientation changes are not yet supported. [ChangeLog][iOS] Accessibility was added to the iOS platform port. This enables Qt applications to be read by VoiceOver on iOS devices. Task-number: QTBUG-39097 Change-Id: I441e844652d528cc2fdcc444f43b54ed6fa04f0c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Accessibility Mac: Cache Accessible Elements and Notify about changesFrederik Gladhorn2014-04-091-2/+1
| | | | | | | | | | | | | | | The big change is that we now keep the id objects representing accessibles around so that they are persistent for ATs. This improves performance of Mac accessibility significantly. This is required for notifications which are now sent so that many things work much better, for example the VoiceOver focus follows the keyboard focus. The parent element in QCocoaAccessibleElement was removed, we can dynamically access it more reliably. Change-Id: I686d212f40d28b392dcc22f16f3c3430f08bdc98 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Accessibility Mac: Fix handling of top level widgetFrederik Gladhorn2014-03-271-40/+13
| | | | | | | | | | | | | | | | | | This simplifies how we handle QNSView for accessibility purposes. Instead of trying to half-merge the top level widget (window->accessibleRoot) into the view, just have the view always return it as child. This makes the accessibility implementation for QNSView simpler and makes applications that show a top level widget such as a button possible. (We would return accessibility ignored for the button before). As a side effect finding the active focus and hit-testing should be more reliable as well. Task-number: QTBUG-37794 Change-Id: Ib52037f88da8887a0bdc77204b0f3daddfe7709d Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Cocoa: Establish pattern for accessing globalsMorten Johan Sørvig2014-02-041-2/+2
| | | | | | | | | | Use a static QCocoaIntegration pointer instead of QGuiApplication. This removes the need to call out of the platform plugin as well as the casting from "platform" to "cocoa" types. Change-Id: If432b3567811223b73a67548e475e07d63635b73 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Remove empty QAccessible2 headerFrederik Gladhorn2013-11-201-1/+1
| | | | | Change-Id: Ia5e9b1adf9280e6b7d7aaf8cb5b5167b694a6070 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Mac Accessibility: unify child functionsFrederik Gladhorn2013-06-241-18/+1
| | | | | | | | | Both ways of getting the children are the same for nsview and qcocoaaccessibleelement. Factor out a function. Change-Id: I4be091c6acde0de519a358f879c24eae04ec4c8d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Mac Accessibility: skip invisible childrenFrederik Gladhorn2013-06-211-0/+3
| | | | | Change-Id: I6c3da526ecef60447a658b6b5501282729e9c6f5 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Cocoa Accessibility: fix ignoring of objectsFrederik Gladhorn2013-06-071-1/+1
| | | | | | | | | | | | | | | | | On Mac it's expected that some elements are filtered out of the a11y hierarchy. We do this with the shouldBeIgnored function. The problem is that we would ignore some objects and then return them in the child attribute function. This is inconsistent and leads to voice over not working. For example having a plain QWidget with other widgets as children would cut off all of these widgets, since the plain QWidget would be ignored. Change-Id: I5f6c26b272e5ca57d59c1ed1ef47e9a2b1181295 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Accessibility Mac: Implement accessibilityFocusedUIElementFrederik Gladhorn2013-04-221-0/+18
| | | | | | Change-Id: I17b5b1f741a8b340d8f4b16f4ec39cc9a8159bfa Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Let platform plugin decide if accessibility is activeFrederik Gladhorn2013-04-191-7/+12
| | | | | Change-Id: I881a8ff3fedf3db73ee37046a4363c70960a92a6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Cache QAccessibleInterfaces.Frederik Gladhorn2013-04-021-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since there already is a one-to-one relationship between QObject and QAccessibleInterface it makes little sense to create and destroy the interfaces on each call to queryAccessibleInterface. Add a cache and keep created interfaces around for the lifetime of the corresponding QObject. This changes the memory management rules: accessible interfaces must no longer be deleted. If you get an QAccessibleIntrface pointer that pointer will stay valid as long as the corresponding QObject is not deleted. This also re-enables accessibility for Mac. We limit the range of the IDs so that they are useable for Windows directly. That means we can get rid of the event cache there. This is based on: Iebf2f374916fc70a9dd29e95f45a6444b85f6cee Change-Id: I9fe6531812c0dbc5b41101ac05830a6dd75e13a3 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Make qaccessible2.h internal.Frederik Gladhorn2013-03-141-1/+1
| | | | | | | | | | | This should have been done right from the start, instead we only made the documentation internal. Also remove the classes from the BIC data. Change-Id: I238a7a7cc5d26980b23931c78e7e5a4477d46920 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* More explicit QCocoaAccessibleElement memory mngmtMorten Johan Sorvig2013-01-091-2/+5
| | | | | | | | | | Don't autorelease in the elementWithInterface function, rename it to createElementWithInterface. The element can then be released immediately or autoreleased ("delete later"). Change-Id: I155a85404c34d756c1752eb7c24a7fb0f3cf2e77 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Don't use NSAccessibilityUnignoredChildren.Morten Johan Sorvig2012-12-141-1/+1
| | | | | | | | | | The function is massively ineffective on deep hierarchies and not strictly needed. (It's supposed to filter out "Ignored" children - VoiceOver will do that anyway based on accessibilityIsIgnored()) Change-Id: I9a74b5f5e9b7880e0d46d5330f7192472eac7a36 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Cocoa: Disable accessibility.Morten Johan Sørvig2012-12-011-0/+4
| | | | | | | | | The accessibility implementation is unstable and causes application crashes. Disable until it has been stabilized. Change-Id: Ic34361a0ad599c6f92df722499d274fe0655646b Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Accessibility Mac: Return textArea as role for multi line text.Frederik Gladhorn2012-11-231-1/+1
| | | | | | Change-Id: I88eb4746463b7372c2dfe089ba74ea4cb0098396 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Cocoa: silence warnings about unused variablesBradley T. Hughes2012-03-261-1/+0
| | | | | | | | Silence warnings about unused function parameters and local variables while building the Cocoa platform plugin. Change-Id: I6aedc4cb21c5fb48d2d6e501561473d3f7112aed Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Use QObject pointer as QCocoaAccessibleElement id.Morten Johan Sorvig2012-01-231-3/+3
| | | | | | | | | | | | | | | 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>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Ignore uninteresting accessibile interfaces.Morten Johan Sorvig2012-01-121-1/+3
| | | | | | | | | Certain interface roles should be ignored and not be a part of the user-visible accessibility interface tree. Change-Id: I264fef909052c528ee505875e3a211a33114d881 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Add support for accessibility actions.Morten Johan Sorvig2012-01-111-1/+1
| | | | | | | | Match Cocoa and Qt actions manually. Some have no corresponding action on the other side. Change-Id: I775cb8987ab843bd88d57d856ef7c0403290db00 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Accessibility: childAt returns interfaceFrederik Gladhorn2011-12-191-23/+8
| | | | | | | | | | | | | | | | | | childAt used to return an integer. Return an interface instead. Not requiring a direct child to be returned allows optimizing by bypassing iterating through the hierarchy of accessibles. For QtQuick this is the only sensible way of implementing this. The bridges are still responsible for finding the top-most element. The default implementation in QAccessibleObject is sufficient to return direct children. The implementation in QAccessibleApplication is therfore no longer needed. Change-Id: Id7100dd5bcc3a98de516a7f4a12eaaa41cb46d26 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Cocoa: Add initial accessibility implementation.Morten Sorvig2011-10-191-0/+117
See qcocoaaccessiblity.h for details. For now only the first level of the hierarchy is made accessible. Also add tools/accessibilityinspector which is an utility for inspecting and debugging the Qt accessibility tree. Change-Id: Iff520bec26b3761feb0c2e00471feb379daaa735 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>