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.

Fixes: QTBUG-103988
Change-Id: I1529bdb0104c6e29d8f28bc0bbb8a7fa4670c7ef
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 9aaf105bad79203065d5e947acfc08d1c82faf86)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
André de la Rocha 2022-06-24 18:20:35 +02:00 committed by Qt Cherry-pick Bot
parent 8785f7014e
commit 091cbe3e11

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;