summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Clean up windows accessibility backendMiguel Costa2024-03-271-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | What was done: * Removed headers in src/gui/accessible/windows/apisupport: as of v13.1.0, MinGW supports most of the definitions in these headers. Including uiautomation.h should be enough. * Removed the QWindowsUiaWrapper class: it's not meant to be extended or itself instantiated, is an "ultra-thin" layer (it even preserves the "all-caps" Win types of function args), and is in effect only a MinGW-bound "kludge". Instead of this class, use the UI Automation API directly, with the assumption that it's available and fully functional, as specified in the MS docs. Any gaps between this assumption and what is delivered by MinGW are bridged with specific (and explicit) temporary "kludges". * Implemented said specific "kludges" in qwindowsuiautomation. For Windows builds, the header just includes uiautomation.h, and the .cpp is empty. For MinGW, the header contains definitions still missing from uiautomation.h, and the .cpp implements functions of the UI Automation core library through imports from the uiautomationcore DLL. * Windows plugins (and tst_qaccessibility): use the UI Automation API definitions directly, instead of the "ultra-thin" wrapper. * Windows plugin builds: use uiautomationcore library, if found. What's intended: * Unburden Gui of the Windows UI Automation COM interfaces and other definitions that are copied in the uia*.h headers. * Make the Windows plugins independent of MinGW shortcomings. * Remove the QWindowsUiaWrapper class that essentially only hides these shortcomings and the "kludge" code needed to overcome them. * As MinGW adds further support to the UI Automation API over time, make it noticeable which workarounds are no longer needed. The current approach of hiding "kludges" in a wrapper class will also hide the fact that they're no longer needed, if/when that time comes. Change-Id: I0070636817d5de81d0b106e9179e2d0442362e2a Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Windows QPA: Always process system sound eventsChristian Heimlich2023-12-131-5/+6
| | | | | | | | | | | | | | | 1b96c75661f678632485513d1323166bc6d74e5c reduced event noise by dropping accessibility events if Windows UI automation has not been activated; however, this did not take into account that some widgets (e.g. QMessageBox) rely on accessibility event processing to emit certain system sounds. Change notifyAccessibilityUpdate() so that system sound related events are processed regardless of accessibility activation. Pick-to: 6.5 6.6 6.7 Change-Id: I22f1516e8fbb3727b065ecc2c30b272b2d6fd1c0 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* platform plugins: use string view types moreAnton Kudryavtsev2023-10-081-2/+3
| | | | | | | Change-Id: I793cfff1afca6b98a672615e33a19f8210e429dd Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Windows QPA: Avoid sending accessibility notifications before activationAndré de la Rocha2022-03-311-0/+7
| | | | | | | | | | | | | | When accessibility was activated after the application startup, it would send state update notifications for every accessible object, which for a large number of objects could result in a flood of UI Automation notifications and UI slowdown. This patch ignores these notifications until QAccessible is activated, which should avoid the slowdown and seems to cause no side effects with accessibility tools. Fixes: QTBUG-95114 Pick-to: 6.2 6.3 5.15 Change-Id: If1495d0aa846d7810b3d297b7e156563a7e5f6e6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Move windowsuiautomation API support into QtGuiFriedemann Kleint2020-05-271-1/+1
| | | | | | Task-number: QTBUG-83255 Change-Id: Ibface71931b6384494842ba9744d76f738c5ca85 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Windows QPA: Fix missing accessible name change eventsAndre de la Rocha2020-05-101-0/+3
| | | | | | | | | | | | | | Accessible name change events were not being relayed through UI Automation. This caused changes in the state of combo boxes and possibly other quick controls to be missed by UI Automation clients. This would result, for instance, in Narrator not reading the state of a combo box when its current index was changed with the keyboard. Fixes: QTBUG-70621 Pick-to: 5.15 Change-Id: I16de0ff2bb0fb5227111d5347c25f442e9b0a533 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Windows QPA: Do not play sound for QMessageBox::NoIconFriedemann Kleint2020-03-061-0/+1
| | | | | | | | | | Amends 2f366a63b20a943ae3099605c2cdb34009ca5602. Task-number: QTBUG-82682 Task-number: QTBUG-81342 Change-Id: I30f465bf432e27828db460f6dbbb59eee0cca8f2 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* Windows QPA: Fix message box and other system soundsFriedemann Kleint2020-01-141-0/+53
| | | | | | | | | | | Re-add the code hooking into QWindowsUiaAccessibility::notifyAccessibilityUpdate() which was removed by 0cf6297c15be45d852be98c862bd0211e6de1aa2. Fixes: QTBUG-81342 Change-Id: Ie97d7cca5b774196d53b675c92d84f4ce208f987 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Windows QPA: Fix QComboBox accessibility with screen readersAndre de la Rocha2019-04-121-0/+3
| | | | | | | | | | | | Screen readers like NVDA and Narrator were not reading the contents of a QComboBox when changing its value using the keyboard, without expanding it, due to missing UI Automation notifications in this case. This change should also help in other cases where updated string values were not notified to screen readers. Fixes: QTBUG-75066 Change-Id: Id7f488380aec5ad27fd11b3cf854d44ab1b28688 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-071-15/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/doc/src/objectmodel/signalsandslots.qdoc src/plugins/platforms/cocoa/qcocoamenuloader.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp tests/auto/gui/image/qimage/tst_qimage.cpp Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Change-Id: I9bd24ee9b00d4f26c8f344ce3970aa6e93935ff5
| * Windows QPA: Fix UIA-to-MSAA accessibility bridgeAndre de la Rocha2018-08-061-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | According to MS sample code, MSAA requests should be replied with UI Automation providers to enable the use the UIA-to-MSAA bridge, in order to support MSAA-only clients. Also changing the mapping of QAccessible::Client from UIA_CustomControlTypeId to UIA_GroupControlTypeId, as it seems more appropriate and avoids an incorrect mapping to a push button type in the UIA-to-MSAA conversion. Change-Id: I5149d250da2d1bd7b14b44ca46e856a81c9be045 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Fix minor stuff in Windows UI Automation supportAndre de la Rocha2018-06-271-8/+3
| | | | | | | | | | | | | | | | | | Adding missing "override" keywords in overridden interfaces, using "#if QT_CONFIG(accessibility)" instead of "#ifndef QT_NO_ACCESSIBILITY", and other minor bits. No change in behavior expected. Change-Id: Ief0e23cb7b577dd3e4af21750b6beccc80d6a2f8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Windows QPA: Fix Qt include statementsFriedemann Kleint2018-05-231-4/+4
|/ | | | | | | | | | | | Change #include <QtCore/QDebug> to #include <QtCore/qdebug.h> according to the coding style. Change-Id: I6ba8a7424c548ddde1d18f3f6f4f87e30973d710 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add support for Windows UI AutomationAndre de la Rocha2017-11-141-0/+140
Replaces the Qt Accessibility Windows back end, formerly based on legacy MSAA, with a new implementation based on UI Automation. Fixes issues with accessibility tools like screen readers and magnifiers, and with the automatic showing and hiding of the virtual keyboard in touchscreen-based Windows computers. [ChangeLog][Windows] The Windows Accessibility back end, formerly based on Microsoft Active Accessibility, was replaced with a new implementation based on Microsoft UI Automation. Task-number: QTPM-487 Task-number: QTBUG-53024 Task-number: QTBUG-43190 Task-number: QTBUG-61926 Task-number: QTBUG-38499 Task-number: QTBUG-38337 Task-number: QTBUG-38501 Task-number: QTBUG-38502 Task-number: QTBUG-38504 Task-number: QTBUG-38505 Task-number: QTBUG-38507 Change-Id: I20b4f8f5e938fef791c6e9c577fcd919140999bd Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>