summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
Commit message (Collapse)AuthorAgeFilesLines
* QtBase (remainder): use printf-style qWarning/qDebug where possible (I)Marc Mutz2016-03-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The printf-style version of QDebug expands to a lot less code than the std::ostream-style version. Of course, you pay in type safety (but compilers warn about it these days), you cannot stream complex Qt types and streaming QStrings is awkward, but in many cases you actually improve on readability. But the main reason is that something that's not supposed to be executed under normal operation has no business bloating executable code size. This is not an attempt at converting all qWarnings() to printf-style, only the low-hanging fruit. In this first part, replace qWarning() << "" with qWarning("..."). Had to fix broken qImDebug() definition. Instead of defining it as a nullary macro in the QT_NO_DEBUG case and as a variadic macro in the other, define it in both cases, as is customary, as a non-function macro so that overload selection works without requiring variadic macro support of the compiler. Saves e.g. ~250b in text size in QtPrintSupport on optimized GCC 5.3 AMD64 builds. Change-Id: Ie30fe2f7942115d5dbf99fff1750ae0d477c379f Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-181-13/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also reverts commit 018e670a26ff5a61b949100ae080f5e654e7bee8. The change was introduced in 5.6. After the refactoring, 14960f52, in 5.7 branch and a merge, it is not needed any more. Conflicts: .qmake.conf src/corelib/io/qstandardpaths_mac.mm src/corelib/tools/qsharedpointer_impl.h tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
| * Accessibility OS X: Fix hang when editing password line editsFrederik Gladhorn2016-01-281-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression when entering data in a password field. The important part is to simply not call convertLineOffset for single line text edits. The reason is that the function when dealing with password fields gets an empty string back when calling textAt etc. This is good since we don't want to leak passwords through a11y apis. The problem with the functions returning empty strings is that we end up in an infinite loop in convertLineOffset. Task-number: QTBUG-49437 Change-Id: I76faa7e33e3ad5c3aeb5c75d8c4b93f1b8227bfc Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
| * Accessibility OS X: protect from accessing invalid objectsFrederik Gladhorn2016-01-281-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Usually when getting an object from an interface, the object can be assumed to be valid. We need to check isValid though since the screen reader access is inherently asynchronous and objects might be in the QWidget destructor where the QObject is still valid. Thus check QAccessibleInterface::isValid in all uses of it in the OS X implementation. Task-number: QTBUG-50545 Change-Id: I6e142f6ead1b3281cab2cbc61ce1406bbfe29f69 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-211-12/+12
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice_p.h src/corelib/kernel/qvariant_p.h src/corelib/tools/qsimd.cpp src/gui/kernel/qguiapplication.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp Change-Id: I742a093cbb231b282b43e463ec67173e0d29f57a
| * Passing parameters to convertLineOffset by pointer instead of referenceFrederik Gladhorn2016-01-181-12/+12
| | | | | | | | | | | | | | | | | | This is aligned with our coding style and it should have been this way from the start. Change-Id: I23a00eb220dd9f17d9239c811b556885a2c0186a Reviewed-by: Fredrik de Vibe <fredrik.devibe@theqtcompany.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* | 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>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-11-041-0/+8
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/ptrsize.test configure src/corelib/global/qnamespace.h src/network/socket/qabstractsocket.cpp tests/auto/other/networkselftest/networkselftest.pro Change-Id: Ic78abb4a34f9068567cea876861d4220f5a07672
| * Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-041-0/+8
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qstorageinfo_unix.cpp src/plugins/platforms/windows/qwindowsmousehandler.cpp src/widgets/styles/qwindowsvistastyle.cpp Change-Id: Ie1725933815891cc8c86258d4c0e8ed0ab386edf
| | * Return early if there is no text at the offsetAndy Shaw2015-10-271-0/+8
| | | | | | | | | | | | | | | Change-Id: I9d0b1e6e054a48bac34fb4e51b656c475f5638b4 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
| | * OS X Accessibility: Make checkboxes etc. checkable with VoiceOverBoris Dušek2015-03-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NSAccessibility has no explicit analog for QAccessibleActionInterface::toggleAction(), checking checkboxes/radio buttons is handled by NSAccessibilityPressAction. So ensure exposing the action properly on OS X so that VoiceOver users can check/uncheck checkboxes, select radio buttons etc. Change-Id: Idc8b048de2313a3e875a929516baf3dded9c68cc Task-number: QTBUG-44852 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-09-251-0/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/io.pri src/corelib/io/qdatastream.cpp src/corelib/io/qdatastream.h src/network/socket/qabstractsocket.cpp src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h src/widgets/styles/qgtkstyle.cpp tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/qmimedatabase-cache.pro tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/qmimedatabase-xml.pro tests/auto/dbus/qdbusconnection/qdbusconnection.pro tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp Change-Id: I347549a024eb5bfa986699e0a11f96cc55c797a7
| * | 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>
* | | Accessibility: OS X: static text should have value instead of titleFrederik Gladhorn2015-08-221-0/+2
|/ / | | | | | | | | | | | | | | | | VoiceOver adds ", text" when reading QLabel when the Title instead of the Value attribute is set. Change-Id: Ic8f94844e858e490ec7e52856dccd4c0a09df88b Reviewed-by: Boris Dušek <me@dusek.me> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-03-241-0/+1
|\| | | | | | | Change-Id: If5d2e621c2fa5476c3ab687a3f4620c54fc3b32e
| * Fixed compilation on Mac OS X (qt namespace and preprocessor issues))Sergei Kulik2015-03-201-0/+1
| | | | | | | | | | | | | | | | Configured with -qtnamespace <...> -no-opengl -D QT_NO_PRINTER Change-Id: I1c959a89afda08d29a854f21e6e51732d136753c Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | OS X Accessibility: Make checkboxes etc. checkable with VoiceOverBoris Dušek2015-03-131-2/+2
|/ | | | | | | | | | | | NSAccessibility has no explicit analog for QAccessibleActionInterface::toggleAction(), checking checkboxes/radio buttons is handled by NSAccessibilityPressAction. So ensure exposing the action properly on OS X so that VoiceOver users can check/uncheck checkboxes, select radio buttons etc. Change-Id: I54b47515cc4882ecf0544c7351bd3c9046023a44 Task-number: QTBUG-44852 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Fixed license headersJani Heikkinen2015-02-171-1/+1
| | | | | Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* OS X Accessibility: fix role descriptionBoris Dušek2015-02-131-1/+1
| | | | | | | Now we take into account also the subrole of the element. Change-Id: I471e7c6620e704780cef48266ef302ec8b56466d Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* OS X Accessibility: implement AXStyleRangeForIndex in QTextEditBoris Dušek2015-02-131-1/+6
| | | | | | | | Not tested as I have no idea what VoiceOver uses it for (it seems to never query this attribute during any operation I tested). Change-Id: Ie5e2b765a9956bcf2be9b659b8914e393ed1ea90 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* OS X accessibility: implement AXRangeForPositionBoris Dušek2015-02-131-0/+5
| | | | | | | | | | | | | | | | This enables users with "Speak text under mouse after delay" set in VoiceOver Utility > Verbosity > Announcements to hover mouse over text in QTextEdit and have it spoken by VoiceOver. It also allows users with Trackpad Commander on to interact with the text area (VO-Shift-arrow down) and "touch-explore" the text while holding their finger on the trackpad and moving it around. [ChangeLog][QtWidgets][Accessibility][OS X] VoiceOver users of QTextEdit can now use mouse and touch exploration on trackpad to point at text to have spoken to them. Change-Id: I6cfaa8b1ff2179cce027b22539ba9ee4f3ee7f3f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Fix AXBoundsForRange in OS X accessibilityBoris Dušek2015-02-131-2/+11
| | | | | | | | | | | | | | | | | | | | | | When returning a rect for AXBoundsForRange, we always incorporated one more character. Along with this one more character being often either a newline or the first character of new softline, visual bounds often got wrongly and unnecessarily multiline when in fact only single line was correct. Also noticeable when moving character by character (VO-Shift-arrow left/right) - now only one character is being shown (as opposed to two before). Still due to VoiceOver bug, for bounds of width less than 8 points, it will draw bounds width with of 8 points (reported as <rdar://problem/19370707>). But still this is an improvement for cases with bounds of width more or equal to 8 points. [ChangeLog][QtGui][Accessibility][OS X] Visual bounds returned by QTextEdit were singificantly improved, this enables VoiceOver to draw properly positioned VoiceOver cursor. Change-Id: Idc50310f8016fbcc01b061d27b655c72922a4807 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Fix accessibility lines on OS XBoris Dušek2015-02-121-16/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make QTextView accessibility on OS X mirror that of NSTextView in terms of translating between positions and line numbers. Most significantly, we report softlines (i.e. "lines" resulting from visual wrapping induced by text view's width) as individual lines, not just hardlines (i.e. "lines" delimited by newline characters, a.k.a. paragraphs). This fixes keyboard echo when using just arrow up and down (without VO prefix) as now in such case VoiceOver reads the softline that the text cursor moved to; before this fix it read again the whole paragraph (which it read no matter to which softline of paragraph we moved to). This enables the user to search more effectively for the softline they need (which they do very often when navigating text). Further, we changed the behavior to report the trailing newline character of a line as the last character of the line. This is consistent with how NSTextView (and TextEdit) does things (and makes the newline character be displayed on a braille display for the user to be able to distinguish that this is really the end of paragraph), but could be debated and changed as some important Apple apps do not include the newline character in the line range (most notably Pages and Mail, both in the document (or email text) text area). I asked about this here: http://lists.apple.com/archives/accessibility-dev/2015/Jan/msg00000.html This also fixes the case where empty line previously returned empty range (length == 0) for AXRangeForLine and VoiceOver interpreted that as end of document even if it was in the middle of document (e.g. in examples/widgets/richtext/textedit, there is an empty line in "Lists" section just before the last paragraph, if one attempted to move past it e.g with VO-arrow down after interacting with the text using VO-Shift-arrow down, then no luck). The code is currently O(N) as the previous one, which could mean a performance problem for bigger documents. As it seems QTextLayout has all the information it needs to do AXLineForIndex and AXRangeForLine efficiently (I would presume O(log N)), this should be eventually rewritten to take advantage of that (but the required interfaces are not currently exposed through QAccessibleTextInterface) [ChangeLog][QtGui][Accessibility][OS X] QTextEdit now properly reports to accessibility visual lines (softlines) as lines, instead of whole paragraphs. This allows better VoiceOver user experience when reading text line by line using arrows up/down. Change-Id: Ie7f06eb919de31d0a083b3b30d26ccac4aa27301 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@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>
* Add searchEdit as accessible stateFrederik Gladhorn2014-10-251-0/+3
| | | | | | | The search state is used by VoiceOver on iOS to announce a search field. Change-Id: I464125827dbbf275daf38104e26e9591bb23365a Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Accessibility OS X: Publish synthetic increase and decrease actionsJan Arve Saether2014-07-011-24/+18
| | | | | | | | | Increase and decrease actions can be generally applied to any value interface. We therefore make them available regardless of the existence of any action interface. Change-Id: If5916c7cfd79812e2139e882a397ac1e040aca78 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵J-P Nurmi2014-06-071-1/+1
|\ | | | | | | refs/staging/dev
| * Cocoa: Adapt to Xcode 6 clang version sudden pickinessGabriel de Dietrich2014-06-031-1/+1
| | | | | | | | | | | | | | Yes, that means OS X Yosemite fix. Change-Id: I236f7af7b803de24ff0895e04c9a9253b5cfdb3b Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | Accessibility iOSFrederik Gladhorn2014-06-061-8/+8
|/ | | | | | | | | | | | | | | | | | | | | 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: implement min/max valueFrederik Gladhorn2014-04-251-0/+25
| | | | | | | | | This commit fixes QProgressBar reading by VoiceOver. Task-number: QTBUG-38272 Change-Id: I549fbebe1aff599e53b14685c1bde6c9fb98aa21 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Accessibility Mac: Make value interface settableFrederik Gladhorn2014-04-251-0/+14
| | | | | | | | | | This will let VoiceOver announce QLineEdit as editable text. It also implements setting of values for value interfaces (eg sliders). Task-number: QTBUG-38258 Change-Id: Ic30c10abc4dc0c4f3c5fe922ac5b0a4bbf4b1e5f Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Accessibility Mac: Fix reading of empty lines in text editFrederik Gladhorn2014-04-251-1/+1
| | | | | | | | | startOffset is already one char past the newline. By adding +1 we would skip one newline if the text was \n\n. Task-number: QTBUG-38257 Change-Id: Ida49a4b690bfa71f134e9be46126f418783a3c97 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Accessibility Mac: Cache Accessible Elements and Notify about changesFrederik Gladhorn2014-04-091-23/+73
| | | | | | | | | | | | | | | 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>
* Mac Accessibility: Make more widgets name/description workFrederik Gladhorn2014-04-051-1/+4
| | | | | Change-Id: I0abe17a59f95818939d6b82500d2463c3f135989 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Accessibility Mac: Fix handling of top level widgetFrederik Gladhorn2014-03-271-1/+17
| | | | | | | | | | | | | | | | | | 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>
* Accessibility Mac: Implement most TextEdit functionsFrederik Gladhorn2014-03-201-21/+68
| | | | | | | | | With this patch reading QTextEdit line by line works with VoiceOver. Task-number: QTBUG-37204 Change-Id: Id9d7c4294254aaa8fe51ee8b612bfbb43348b777 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Accessibility Mac: Implement setting focusFrederik Gladhorn2014-03-201-2/+8
| | | | | | | | [ChangeLog][QtGui][Accessibility] Allow assistive apps such as VoiceOver to set the focus on widgets and controls. Change-Id: I657bf7d827c5e5293cfd628dbb6b8f0592a84f24 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Accessibility Mac: Fix TextEditFrederik Gladhorn2014-03-201-0/+94
| | | | | | | | | [ChangeLog][QtGui][Accessibility] Implemented text attributes to enable VoiceOver to read QTextEdit and QPlainTextEdit. Task-number: QTBUG-37204 Change-Id: Ie2fa8086a1bcf4907ac59850dc5c6c08b5f0b7f2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Prevent a crash when there is no accessible interfaceAndy Shaw2013-12-211-1/+4
| | | | | Change-Id: I058b76ff9d40b75eb51f9a6b1b89032ead629aed Reviewed-by: Liang Qi <liang.qi@digia.com>
* Remove empty QAccessible2 headerFrederik Gladhorn2013-11-201-2/+1
| | | | | Change-Id: Ia5e9b1adf9280e6b7d7aaf8cb5b5167b694a6070 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Mac Accessibility: unify child functionsFrederik Gladhorn2013-06-241-19/+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-4/+2
| | | | | | | | | | | | | | | | | 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: Enable ignoring of childrenFrederik Gladhorn2013-04-161-1/+2
| | | | | | | | | | | | | 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>
* Cache QAccessibleInterfaces.Frederik Gladhorn2013-04-021-49/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+8
| | | | | | | | | | 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>
* Cocoa: make accessibility hit test not crashMorten Johan Sørvig2012-12-161-0/+4
| | | | | | | | | Check if the accessibility element is valid before calling childAt. Change-Id: Id63c11f18b262c3c3a839db8ee2d11c0d7adc822 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Fix memory leak in cocoa accessibility.Morten Johan Sorvig2012-12-141-1/+1
| | | | | | | | Autorelease ("delete later") the created attribute name array. Change-Id: I2d7af9eb1fd899f04c8acb90204600a2dd43fa20 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>