Windows QPA: Report the expanded/collapsed state of tree items

Implement the ExpandCollapse UI Automation pattern for tree items,
so that accessibility tools like MS Narrator are able to report the
item state.

Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-103988
Change-Id: I1529bdb0104c6e29d8f28bc0bbb8a7fa4670c7ef
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
bb10
André de la Rocha 2022-06-24 18:20:35 +02:00
parent efbcc80010
commit 9aaf105bad
1 changed files with 2 additions and 1 deletions

View File

@ -345,7 +345,8 @@ HRESULT QWindowsUiaMainProvider::GetPatternProvider(PATTERNID idPattern, IUnknow
if ((accessible->role() == QAccessible::MenuItem
&& accessible->childCount() > 0
&& accessible->child(0)->role() == QAccessible::PopupMenu)
|| accessible->role() == QAccessible::ComboBox) {
|| accessible->role() == QAccessible::ComboBox
|| (accessible->role() == QAccessible::TreeItem && accessible->state().expandable)) {
*pRetVal = new QWindowsUiaExpandCollapseProvider(id());
}
break;