Fix tree/table/list accessibility state
The accessibility class associated with trees, tables and lists was reporting a default/empty state, causing issues with accessibility tools. Fixes: QTBUG-92964 Change-Id: I9c8ee5e7e582fd6b6a59cd70437eeddad0f4eb8e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 0d3f09ac0231fca114aa58553144b78f8040a2e1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
d3375534ac
commit
3bdd3b8aa5
@ -373,7 +373,27 @@ QAccessible::Role QAccessibleTable::role() const
|
||||
|
||||
QAccessible::State QAccessibleTable::state() const
|
||||
{
|
||||
return QAccessible::State();
|
||||
QAccessible::State state;
|
||||
const auto *w = view();
|
||||
|
||||
if (w->testAttribute(Qt::WA_WState_Visible) == false)
|
||||
state.invisible = true;
|
||||
if (w->focusPolicy() != Qt::NoFocus)
|
||||
state.focusable = true;
|
||||
if (w->hasFocus())
|
||||
state.focused = true;
|
||||
if (!w->isEnabled())
|
||||
state.disabled = true;
|
||||
if (w->isWindow()) {
|
||||
if (w->windowFlags() & Qt::WindowSystemMenuHint)
|
||||
state.movable = true;
|
||||
if (w->minimumSize() != w->maximumSize())
|
||||
state.sizeable = true;
|
||||
if (w->isActiveWindow())
|
||||
state.active = true;
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
QAccessibleInterface *QAccessibleTable::childAt(int x, int y) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user