aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickwidgets/qaccessiblequickwidget.cpp
Commit message (Collapse)AuthorAgeFilesLines
* a11y: support attributes for QQuickWidgetVolker Hilsheimer2025-06-161-1/+1
| | | | | | | | | | | | Follow up on the addition of QAccessibleWidgetV2 in qtbase, which also implements the QAccessibleAttributesInterface to report the widget's locale. Pick-to: 6.10 Change-Id: I9704e25342b4ca73c9b6aa6a97194870b4e6212b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io> Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
* Fix crashes after 645aaa25b17Michal Klocek2023-04-191-3/+7
| | | | | | | | | | | | | | | WebEngine during page setup can create and delete accessibility interface with QAccessible::deleteAccessibleInterface, which will later on tear down end with a crash as lambda function is called on non existing object. In case accessibility interface is deleted do not try to call repair window. Pick-to: 6.5 Task-number: QTBUG-108226 Change-Id: Ic052d1b6c9c60168fb32f81134263fc484ee654b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QQuickWidget: don't crash in accessibility when reparentingVolker Hilsheimer2023-04-181-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QAccessibleQuickWidget delegates all calls to the QAccessibleQuickWindow, which it had as a member that was initialized at construction time to the offscreenWindow backing the QQuickWidget. Both are QAccessibleObject subclasses, and QAccessibleObject stores the object it wraps as a QPointer. The QAccessibleQuickWindow's object becomes null when that offscreen window gets destroyed (for instance, when reparenting). We might get called by the accessibility framework in that situation, as we are clicking a button and the hierarchy changes. To prevent crashes, we need to test for nullptr in QAccessibleQuickWindow. However, that alone would leave us with a useless QAccessibleQuickWindow, and in turn with a useless QAccessibleQuickWidget instance. The QAccessibleQuickWindow is not directly exposed to the accessibility framework, and all calls to it are dispatched through its QAccessibleQuickWidget owner. We can't repair the QAccessibleQuickWindow but we can replace it entirely if we manage it as a heap-allocated object. Use a std::unique_ptr for that, which we can reset with a new instance created from a new offscreen window in order to repair things. We can now either test in all functions whether the window's window is still alive. Or we can handle the destroyed() signal of the offscreen window. The latter solution is a bit more involved, but generally more scalable as we don't have to remember to check, and possibly repair, in each QAccessibleQuickWidget function. Pick-to: 6.5 Fixes: QTBUG-108226 Change-Id: Ib19c07d3679c0af28cb5aab4c80691cc57c4e514 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-111-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. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Make QaccessibleQuickWidget private APIFabian Kosmale2021-06-021-1/+1
| | | | | | | | | Its base class is private API, so it should be private API, too. Change-Id: Ic80f841fee19ed0305c60ad5f8e9349a05f09e5e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Implement accessibility for QQuickWidgetMorten Johan Sørvig2021-06-011-0/+110
The accessibility tree for the Qt Quick content should be rooted at the QQuickWidget, and not at the offscreen QQuickWindow. For this to be the case, several things must happen: - QQuickWindow must not report the child interfaces - QQuickWidget must report the child interfaces - The child interfaces must report the QQuickWidget as the parent Create accessibility interfaces for QQuickWidget and and QQuickWigetOffscreenWindow (which now gets a proper subclass), where the QQuickWidget interface reports the child interfaces and the QQuickWigetOffscreenWindow reports no children Change the code in QAccessibleQuickItem to use the true (visible) window, where needed. Fixes: QTBUG-67290 Change-Id: I387d0ef711138d248a8dd16eefc9839499b35eeb Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>