summaryrefslogtreecommitdiffstats
path: root/src/gui/accessible/qaccessiblecache.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add ; to Q_UNUSEDLars Schmertmann2020-07-071-1/+1
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* a11y: Fix bug in the accessibility cacheJan Arve Sæther2020-05-191-4/+60
| | | | | | | | | | | | | We could sometimes cache a partially constructed object if the accessibility interface for that was created during construction time of the object. This usually ended up in that the interface for e.g. QMenuBar was stored in the cache as a QAccessibleWidget, regardless of if the a11y factory supported it. Since it was already in the cache, it remained the same for the entire lifetime of the application, causing e.g. QMenuBar not have the correct accessibility behavior. Task-number: QTBUG-83993 Change-Id: I72b2d5a93f6b397fd3666d45951109e3e5aff754 Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* Add logging for QAccessibleCacheFrederik Gladhorn2018-07-081-0/+6
| | | | | Change-Id: I2cbaf6c6dfb80b2b5c2732f1633da411fd816710 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix deletion of items in QAccessibleCacheFrederik Gladhorn2018-07-081-2/+4
| | | | | | | | | | | | Items in the cache may be part of the parent/child hierarchy. Make sure not to have dangling pointers in the cache, but rather cleanly remove all interfaces that get deleted since they may delete each other (TabBar deletes its child interfaces for example. Task-number: QTBUG-69283 Change-Id: Iad17cd1d3356804b3d8cbba8632ec22b836c3521 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Accessibility: Fix leaking cached interfacesFrederik Gladhorn2018-05-041-0/+6
| | | | | | | | | When the application closes, we should clear the cache to not run into memory sanitizers claiming that we leak. Change-Id: Ibf9fcda107be6b7f3ed414d7651080aa1f61a3a5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-191-1/+1
| | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QAccessibleCache: Replace Q_GLOBAL_STATIC by instance pointerFriedemann Kleint2017-01-281-2/+12
| | | | | | | | | | | | QAccessibleCache is a QObject which emits signals at destruction time. This can lead to crashes in situations where the library is unloaded after QApplication has been deleted, for example in PySide2. Change it to a pointer instance variable that is cleaned up by a post routine. Task-number: PYSIDE-452 Change-Id: If0d673c7dfe33c8d2d7298bc081824f9d6d7efdc Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-151-1/+8
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakeevaluator.cpp One side changed the iterator to use ranged-for, the other changed its body; they only conflicted because the latter had to add braces around the body, intruding on the for-line. Trivial resolution. Change-Id: Ib487bc3bd6e3c5225db15f94b9a8f6caaa33456b
| * Improve lookup speed for QAccessible::uniqueIdAlexandru Croitor2016-07-071-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When QAccessible::uniqueId was called, it would call QHash::key(), which has linear time performance. This can cause application slowdown if a big number of QAccessibleInterface Ids have to be found. The patch adds an additional QHash to keep track of the inverse relationship from QAccessibleInterface pointers to their Ids. Change-Id: I975e3dc0e6c628e2ea701323d8b87184ad133cfb Task-number: QTBUG-54491 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@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>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-291-18/+10
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/image/qimage.cpp src/gui/image/qppmhandler.cpp src/gui/kernel/qguiapplication.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
| * Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | Compile with -no-feature-accessibilityFrederik Gladhorn2014-08-211-0/+4
|/ | | | | | Task-number: QTBUG-38045 Change-Id: Id436b70aa6161bdf2428ca0a605212b278c71849 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.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-1/+12
| | | | | | | | | | | | | | | 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>
* Use new connect syntaxFrederik Gladhorn2014-01-101-1/+1
| | | | | Change-Id: I61ada9387c6d09f86afa8ace46257c7e5ef27e72 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Accessibility for AndroidFrederik Gladhorn2013-08-221-1/+3
| | | | | | | | | | | | | | | | This enables both modes for TalkBack, explore-by-touch and the normal swiping mode. It is partially inspired by the BarGraphView example of the Google/Android Eyes-Free project. Note that for any accessibility to work you'll need a device with api level 16 at least. Using reflection we should be able to dynamically pick up the classes if we have the high enough api level. Change-Id: I11b93bead451483782a1711434d45c8f9a35996f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Cache QAccessibleInterfaces.Frederik Gladhorn2013-04-021-0/+116
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>