summaryrefslogtreecommitdiffstats
path: root/src/gui/accessible/windows
Commit message (Collapse)AuthorAgeFilesLines
* Clean up windows accessibility backendMiguel Costa2024-03-2712-1445/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* a11y: Fix bug where some characters were not spoken while moving cursorJan Arve Sæther2023-11-231-0/+56
| | | | | | | | | | | | | | | | | | The problem occurred when we moved the cursor to the penultimate character of the string, because the boundary condition was wrong. It is important to realize that the offsets are moved *between* each character (and also before and after the whole string), just like you would move a cursor. This means that the offsets can be in the range [0, len] (closed interval) The problem could only be reproduced with JAWS. Pick-to: 6.6 6.5 6.2 Fixes: QTBUG-115156 Change-Id: I0c5f05fa391e6c7744ab22d71afe8904b49e89bc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
* a11y uia: Report UIA_StrikethroughStyleAttributeIdMichael Weghorn2023-11-151-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | Implement support for getting the strikethrough style (UIA attribute UIA_StrikethroughStyleAttributeId [1]) by checking for the corresponding IAccessible2 text attribute "text-line-through-type" [2] and mapping the value accordingly if set. Only report those attributes from the QAccessibleTextInterface::attributes return value, if they apply for the whole range of the QWindowsUiaTextRangeProvider. With this in place, the NVDA screen reader on Windows announces "strikethrough" as expected when asked to report the formatting information (e.g. via NVDA+f shortcut) for the QTBUG-118106 example. [1] https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-textattribute-ids [2] https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes Task-number: QTBUG-118106 Change-Id: I2fa060bd3bf493227bba766385f34d224497784c Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Revert "Windows QPA: Add support to UiaRaiseNotificationEvent()"Jan Arve Sæther2023-08-163-28/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 566def740ec58e842e6bb37177f80e20aebaa245. The fix had some unwanted side-effects when the QAccessibleValueChangeEvent carried a value of type string. Only QComboBox uses QAccessibleValueChangeEvent in such a way. The consequence of the reverted patch was that it broke QComboBox so that the screen reader would read aloud the value change event regardless of the visibility or focus state of the QComboBox. (Thus, if you e.g. changed the QComboBox::currentIndex on a *hidden* combo box, the screen reader would still read aloud the event) This is also the root cause of what is described in QTBUG-93763. Also, due to the usage of NotificationProcessing_ImportantMostRecent the screen reader would treat it as such an important event that it would abort whatever it was currently speaking. In addition, the reverted change didn't fix any bugs and it failed to implement the suggested behavior in a correct way (as was described in QTBUG-75003 - albeit properly described after the change was merged). QTBUG-75003 has already been reopened due to this, and the change can therefore be reverted quite risk-free. Task-number: QTBUG-75003 Task-number: QTBUG-93763 Pick-to: 6.6 6.5 6.2 5.15 Change-Id: Ib91872adc563c31534fe2b30fd9c447bfcca6b40 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* a11y uia: Support ISelectionProvider2Michael Weghorn2023-07-182-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support UIA's ISelectionProvider2 interface [1] in addition to ISelectionProvider. The ISelectionProvider2 interface inherits from the ISelectionProvider interface. A follow-up commit that will introduce bridging the QAccessibleSelectionInterface, introduced in commit 9d16d5e2245c26e5746fd7609300b84a2a983457. While at it, also reserve space for the amount of children in the QList in QWindowsUiaSelectionProvider::GetSelection before inserting them one by one, to avoid reallocations. Sample use of the ISelectionProvider2 interface from NVDA's Python console [2] with this commit in place: 1) start NVDA 2) run the gallery example (examples\widgets\gallery\gallery.exe) 3) click on the "Style" listbox at the top 4) press Numpad_insert+control+z to start the NVDA Python console and capture snapshot variables 5) query and use the interface using NVDA's Python console >>> import UIAHandler >>> iselection2 = focus.parent.UIAElement.GetCurrentPattern(10034).QueryInterface(UIAHandler.IUIAutomationSelectionPattern2) >>> iselection2.CurrentItemCount 1 >>> iselection2.CurrentFirstSelectedItem.CurrentName 'windowsvista' >>> iselection2.CurrentLastSelectedItem.CurrentName 'windowsvista' [1] https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcore/nn-uiautomationcore-iselectionprovider2 [2] https://www.nvaccess.org/files/nvda/documentation/developerGuide.html#PythonConsole Change-Id: I43642e9e39b63c65da97af976cc322a8e5868170 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1612-456/+24
| | | | | | | | | | | | | 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>
* Remove the qmake project filesJoerg Bornemann2021-01-072-16/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Move windowsuiautomation API support into QtGuiFriedemann Kleint2020-05-2714-0/+1823
Task-number: QTBUG-83255 Change-Id: Ibface71931b6384494842ba9744d76f738c5ca85 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>