summaryrefslogtreecommitdiffstats
path: root/src/gui/accessible/qaccessible.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Accessibility Mac: Cache Accessible Elements and Notify about changesFrederik Gladhorn2014-04-091-15/+13
| | | | | | | | | | | | | | | 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: Do not assert when a widget doesn't have a QAIFrederik Gladhorn2014-01-021-0/+2
| | | | | | | | | | [ChangeLog][QtGui] Fixed crash when sending accessibility updates when the corresponding widget does not have a corresponding QAccessibleInterface. This showed on Mac for example with QStatusBar. Task-number: QTBUG-35421 Change-Id: I94174e98e858b7a0122532ee5fcc8458a263bccd Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Accessibility: Make it possible to send events with no QObjectFrederik Gladhorn2013-10-251-5/+36
| | | | | Change-Id: Icbb9d15ec52ff5f7718eaf3600cab140971274aa Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-7/+7
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Make Accessibility publicFrederik Gladhorn2013-09-191-67/+885
| | | | | | | | | There is no point in having QAccessible2, so merge it with the normal QAccessible. The header will be removed in a subsequent commit as it is still needed by declarative at this point in time. Change-Id: I1fc47d484d482f25387eba827bc5a373536b7a8b Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Let platform plugin decide if accessibility is activeFrederik Gladhorn2013-04-191-8/+13
| | | | | Change-Id: I881a8ff3fedf3db73ee37046a4363c70960a92a6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Do not show the warning if queryAI() returns an invalid interface.Jan Arve Saether2013-04-111-1/+1
| | | | | | | | | | | | | | | | We should only warn about missing a11y plugins if iface is 0, since we obviously have the plugin otherwise. This got triggered by that a visible widget got destructed, which in turn called hide(), which ultimately ended up calling QAccessible::updateAccessibility(QAccessible::ObjectHide). When QAccessibleEvent::accessibleInterface() then called queryAccessibleInterface(), QAI::isValid() would return false because the widget was in its destructor. Change-Id: If655e00e7bb3737a39e24e26dbd1e23edd515bf5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Make QTextCursor accessibility boundary finder availableFrederik Gladhorn2013-04-081-0/+73
| | | | | | | | | This allows re-using the function in QtQuick. In addition TextBoundaryType is moved to QAccessible and QAccessible2 as namespace ceases to exist. Change-Id: I184bc2c181a22ca51ac4db4e5a080dc26d4acfe0 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Cache QAccessibleInterfaces.Frederik Gladhorn2013-04-021-12/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix access to interface in QAccessibleEventFrederik Gladhorn2013-03-231-1/+1
| | | | | | | | | Sometimes we get an invalid interface. In that case the event should just return 0. This avoids some potential crashes. Change-Id: I9f166b5d5547dbe7f22c4756502aee811b0b80a6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Warn about accessibility interface creation failure only onceFrederik Gladhorn2013-03-141-1/+6
| | | | | Change-Id: I0555d7d2417149f0eec54b228b842a61d0d08f85 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-221-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge branch 'stable' into devFrederik Gladhorn2013-01-071-4/+10
|\| | | | | | | | | | | | | Conflicts: tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp Change-Id: I6b8d505fc22f052c307ca27f58f7d16f98965f47
| * Revert "Enable module build with QT_NO_ACCESSIBILITY"aavit2013-01-041-4/+10
| | | | | | | | | | | | | | | | | | | | This reverts commit b7f63c6bf74a0eb62bb49c1085584da1b3714a06. It made compilation fail in qstylehelper_p.h if QT_NO_ACCESSIBILITY was defined - which it is by default on linux without dbus. Change-Id: I313f5138460d28c44dad128d175df0e53a99287d Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | Merge branch 'stable' into devFrederik Gladhorn2013-01-041-10/+4
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/painting/shared/shared.pri src/corelib/tools/qharfbuzz_p.h src/corelib/tools/qunicodetools.cpp src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp Change-Id: Ibc9860abf570e5ce8b052fb88feb73ec35e64bd3
| * Enable module build with QT_NO_ACCESSIBILITYTasuku Suzuki2012-12-201-10/+4
| | | | | | | | | | | | Change-Id: I330c3ddd70232d94eae5543cb0282b962e67eae5 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | Cache accessibility plugins.Morten Johan Sorvig2013-01-021-2/+22
|/ | | | | | | | | | | | | | Profiling shows that the cost of QAcccessible:: queryAccessibleInterface is dominated by plugin loading. (json parsing etc.) Cache QAccessiblePlugin per class. Also cache the fact that no plugin is found for a certain class. This speeds up the average queryAccessibleInterface call by a factor of 10X Change-Id: Iab6d052dec499a2203d1dcc4672a8a543b279239 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Fix compile when we use QT_NO_ACCESSIBILITYMontel Laurent2012-12-011-0/+4
| | | | | Change-Id: I2d304fa6d91d86130eeb4a4aa07b43173d240312 Reviewed-by: David Faure <david.faure@kdab.com>
* Accessibility: Add documentationFrederik Gladhorn2012-11-151-10/+265
| | | | | | | | | This keeps the docs as internal, but add information about the events. Change-Id: I9b961a946a6d799232a756a9ac874c0caf91ecbc Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Accessibility: Warn if an event cannot create an interface for some reason.Frederik Gladhorn2012-11-081-1/+3
| | | | | Change-Id: I87d0290286243f8ead114e238798c9a7b882d978 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Fix QAccessible to build when QT_NO_ACCESSIBILITY is definedJ-P Nurmi2012-11-051-0/+10
| | | | | Change-Id: I6104633cdc80425b8f4697acd28c9a156cd0d76f Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Remove #ifndef QT_NO_ACCESSIBILITY around qaccessible.{h,cpp}Jan Arve Saether2012-11-011-3/+0
| | | | | | | | | | | | | | | Jens has an use-case for using accessibility from styles. By making the enums always available regardless of QT_NO_ACCESSIBILITY, it makes the style code less littered with ifndefs. It should (ahem) also solve the problem where Qt Desktop components does not compile if QT_NO_ACCESSIBILITY is not defined. This happens on some linux distros, since atspi-2-dev is not installed by default, which again causes grief for those affected. Change-Id: I15d65df8c752a0c4af37cc7b4d908a757cb6a9c4 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@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>
* Use QStringList::join(QChar) overload where applicable [QtGui]Marc Mutz2012-09-071-1/+1
| | | | | | | | | | This is an automated change performing the following replacements: join\("(.)"\) -> join('\1') join\(QLatin1String\("(.)"\)\) -> join(QLatin1Char('\1')) join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1')) Change-Id: Id8d43c1b1ca9cd3aa0b4eedca6709b6287a9bc98 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* doc: Fixed qdoc errorsMartin Smith2012-08-211-105/+76
| | | | | | | | | | These classes will not be public until Qt 5.1. This change marks a few things internal, so they don't cause qdoc errors in Qt 5.0. It also adds a few qdoc comments for future use in Qt 5.1. Change-Id: If90692b97653223d8a986f2ae1fff49c20cd444b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Improve qDebug() << QAccessibleEvent() to display state changesJan-Arve Saether2012-07-161-0/+44
| | | | | Change-Id: I4624bcf94c1290d14ea5f5eaaa5449af10ac2186 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Get started with patching up the Qt GUI docsGunnar Sletta2012-06-281-0/+2
| | | | | | | | Primary goal, make the front page of the Qt GUI module a bit more clarifying and avoid downstream references inside the Qt GUI docs. Change-Id: Icbcfbb64b93963add889bf83711daa9575885c02 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove the QFactoryInterface dependency from accessible pluginsLars Knoll2012-06-081-1/+1
| | | | | | | QFactoryInterface is not needed anymore and will get removed soon. Change-Id: Ib2806200b1a7f4a45d62e2b556380946ef68f585 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Merge branch 'docs-refactoring' into masterMarius Storm-Olsen2012-05-101-1/+1
|\ | | | | | | Change-Id: Iebd1966abace3cdf7f9428dcfc1ded5b124ab113
| * Doc: Modularize QtGui documentation.Casper van Donderen2012-05-091-1/+1
| | | | | | | | | | | | | | | | This change moves the snippets and images to the modularized directories. Change-Id: I5f86f598fbe7c47d632c613b85d94ced89ba2c29 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* | No longer use deprecated methods for plugin loading.Friedemann Kleint2012-05-091-15/+8
| | | | | | | | | | Change-Id: I19c66b1c41ea4dd236726c86d7d071b210ec9244 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Expose QPA API under qpa/*Girish Ramakrishnan2012-05-071-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main reasons for doing this are: 1. _qpa.h end up in the master QtGui include file. QtGui is meant for userland applications. qpa code is neither binary nor source compatible. Inadvertant use of QPA api makes the user code binary-incompatible. 2. syncqt creates forwarding headers for non-private header files. This gives people the impression that this is public API. As discussed on the mailing list, even though QPA api is internal and subject to change, it needs to treated differently from private headers since they will be used by in-qtbase and out-of-qtbase plugins. This commit does the following: 1. The _qpa in QPA header files is dropped. 2. syncqt now treats any file with qplatform prefix as a special file and moves it to qpa/ directory. The recommended way of using QPA API in plugins is: #include <qpa/qplatformfoo.h>. This allows the user include QPA API from multiple modules (for example, qplatformfoo might be in QtPrintSupport) 3. The user needs to explicitly add QT += <module>-private to get access to the qpa api. 4. Creates compat headers for the olden style qplatformfoo_qpa.h and QPlatformFoo includes. This commit does not change the cpp filenames. This requires a more careful merging of existing non qpa cpp files and existing cpp files on a case by case basis. This can be done at anytime. The following files are not renamed as part of this changed but will be fixed as part of a future change: src/gui/kernel/qgenericpluginfactory_qpa.h src/gui/kernel/qgenericplugin_qpa.h src/gui/kernel/qwindowsysteminterface_qpa.h files were renamed using for x in `find . -name "qplatform*_qpa.h"`; do git mv $x "${x/_qpa.h/.h}"; done for x in `find . -name "qplatform*_qpa_p.h"`; do git mv $x "${x/_qpa_p.h/_p.h}"; done includes were renamed using script for file in `find . -name "*.h" -or -name "*.cpp" -or -name "*.mm"`; do sed -i -e 's,.*#.*include.*<\(Qt.*/\)\?\(QPlatform.*\)>,#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.*"\(Qt.*/\)\?\(QPlatform.*\)",#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.* "\(qplatform.*\)_qpa.h",#include <qpa/\L\1.h>,g' \ -e 's,.*#.*include.*"\(qplatform.*\)_qpa_p.h",#include <qpa/\L\1_p.h>,g' \ -e 's,.*#.*include.*<\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)>,#include <qpa/\2\3>,g' \ -e 's,.*#.*include.*"\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)",#include <qpa/\2\3>,g' \ $file done Change-Id: I04a350314a45746e3911f54b3b21ad03315afb67 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fix compilation of public headers with QT_NO_DEPRECATED definedOlivier Goffart2012-05-021-8/+1
| | | | | | | | | | Put the functions in QT_DEPRECATED_SINCE if possible QPluginLoader::staticInstances is not documented as deprecated, and do not reference any alternative use. So I unmarked it as deprecated. Change-Id: I556c3f3657fb0490dd5543fcc56718fe9bd394e7 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Add QDebug operator<< for QAccessibleEventJan-Arve Saether2012-04-241-0/+16
| | | | | | | (Keep it internal) Change-Id: I9e99ccbd16cc595d2aff97a26181e8d8c3d9d7ae Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Add missing accessible child id.Frederik Gladhorn2012-03-281-0/+1
| | | | | | | In the deprecated function the child parameter got lost. Change-Id: Ieeef19100bffaaa6079185dae6ae5bf82dcd7a60 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Remove QAccessibleEvent child parameter.Frederik Gladhorn2012-03-191-1/+2
| | | | | | | | | This makes the api cleaner and generally the child should not be there. It is only sometimes more convenient not to create a QAccessibleInterface instance, so the functionallity is kept. Change-Id: I26018a6d3e0549f4d79856775b4167c5660e229d Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Accessibility: add text update eventsFrederik Gladhorn2012-03-191-7/+7
| | | | | Change-Id: Iece9d100b3f5a379d7d8e29dea67a10d0c918c06 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Use pointers for QAccessibleEvent.Frederik Gladhorn2012-03-151-4/+3
| | | | | | | | | At least on mac g++ badly wants to copy the event and cannot use the copy ctor. The sensible solution is thus to use pointers. This is in line with QCoreApplication::sendEvent. Change-Id: Icb58852be351ab04ffa17069989d7a07d4b377da Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Add documenation about QAccessibleStateChange event.Frederik Gladhorn2012-03-121-0/+23
| | | | | Change-Id: Iea34d71d71a6dd58f761722ce20ae8ec2b81ae58 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Update accessibility StateChange by custom event.Frederik Gladhorn2012-03-121-1/+2
| | | | | | | | Subclass QAccessibleEvent to give details what changed in the state change. Change-Id: I9005d311e85a3c8bfa6e062833fa6a8a7dc6a4a4 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Add accessible role Desktop.Frederik Gladhorn2012-03-081-0/+2
| | | | | | | | | Another role that is mostly needed to make Qt based desktops accessible. Would be nice to have for KDE's Plasma in the future. Change-Id: I1d2ce9d55d677f73cc59f0a3646ee5e588c1d948 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com> (cherry picked from commit edc6fae534835a2c72edffb52255fe522a37928f)
* Remove AccessibilityPrepare event.Frederik Gladhorn2012-03-051-4/+0
| | | | | | | | | | | | | This event was completely unused. In addition it leads to crashes on linux when sending the Destroy accessibility update. The Destroy event on linux would still query an accessible interface. That in turn would trigger the event to be sent. Change-Id: I8915527de067b8b70ba41b1361e3ef5d12866d7d Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-021-5/+5
| | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Mark overload of QAccessible::updateAccessibility as deprecated.Frederik Gladhorn2012-03-021-2/+0
| | | | | | | | updateAccessibility(const QAccessibleEvent &event) should be used, updateAccessibility(QObject *object, int child, Event reason) is deprecated. Change-Id: I92b32579ff202681189e9581365d2891e5d1e994 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Improve debugging in the windows accessibility bridge.Jan-Arve Saether2012-03-021-4/+16
| | | | | | | | set QT_DEBUG_ACCESSIBILITY=(1|0) to turn logging on or off Change-Id: Ibd5b77699decf0cf02bc6b6cc656fa237de29124 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Make accessible interfaces private for Qt 5.0Jan-Arve Saether2012-02-281-0/+4
| | | | | | | | | Since we're not yet confident if they serve their purpose well enough, we have decided to make them internal so that we are free to tune them later Change-Id: Id79d154e0537aca07303afea5d057cfcb0773384 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Minor fixes for RelationFlag.Jan-Arve Saether2012-02-241-0/+2
| | | | | | | | | * Document AllRelations * Assigned new values (starting from 1) for the remaining members of the enum. Change-Id: I55ec197f24ff7d43ff3c0d101edd33b9615f9287 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Remove QPlatformIntegration/QPlatformTheme from QGuiAppPrivate.Friedemann Kleint2012-02-201-0/+1
| | | | | | | Forward-declare instead. Change-Id: I3851994e8bc05b389e94e948478339ba33d521c1 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove QAccessibleInterface::relationTo().Jan-Arve Saether2012-02-201-42/+4
| | | | | | | | QAccessibleInterface::relations() replaces both relatedTo() and some of the RelationFlags that navigate() handled before. Change-Id: I4b9d2c28ba3d753efe7cc9bfa0ad68bed3ee02fd Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>