Windows QPA: Fix accessibility focus event for table/tree/list
The focused element within a table, tree or list was not being informed in the UI Automation focus change events, causing the focused element to be missed by screen readers. Fixes: QTBUG-91029 Change-Id: I738502e6871358508b4510763018837c304b618e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit f1eccab04e01b3acc1a4b4c6a5fe7b3af3e2dcba) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
8bed35c07e
commit
7432281cc9
@ -107,6 +107,17 @@ QWindowsUiaMainProvider::~QWindowsUiaMainProvider()
|
||||
void QWindowsUiaMainProvider::notifyFocusChange(QAccessibleEvent *event)
|
||||
{
|
||||
if (QAccessibleInterface *accessible = event->accessibleInterface()) {
|
||||
// If this is a table/tree/list, raise event for the focused cell/item instead.
|
||||
if (accessible->tableInterface()) {
|
||||
int count = accessible->childCount();
|
||||
for (int i = 0; i < count; ++i) {
|
||||
QAccessibleInterface *item = accessible->child(i);
|
||||
if (item && item->isValid() && item->state().focused) {
|
||||
accessible = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (QWindowsUiaMainProvider *provider = providerForAccessible(accessible)) {
|
||||
QWindowsUiaWrapper::instance()->raiseAutomationEvent(provider, UIA_AutomationFocusChangedEventId);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user