Add "checkable" state to accessible menu item

The information about whether a menu item may be checked is necessary
to allow the platform code (in particular, Windows UI Automation layer)
to make this information available to screen readers.

Task-number: QTBUG-80551
Change-Id: Ibfcc4f2da1ebc68e7dc5df2cd46bbfc0a177da12
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Andre de la Rocha 2019-12-06 20:09:29 +01:00
parent 73fada6d70
commit e40e82ede1

View File

@ -299,6 +299,8 @@ QAccessible::State QAccessibleMenuItem::state() const
s.disabled = true; s.disabled = true;
if (m_action->isChecked()) if (m_action->isChecked())
s.checked = true; s.checked = true;
if (m_action->isCheckable())
s.checkable = true;
return s; return s;
} }