summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndre de la Rocha <andre.rocha@qt.io>2020-03-25 02:24:32 +0100
committerAndre de la Rocha <andre.rocha@qt.io>2020-03-26 14:24:43 +0100
commitc91b7f15ce3e38f013c91cdd7cf66145ee00a521 (patch)
treeeafa16bd4454f18d51afd9a30c56a0411fa0f7f1 /src
parentfc49325c806d03b609e0e0206086edadc7f2782e (diff)
Add "checkable" state to QAccessibleTableCell
The information about whether a table/tree 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-81919 Change-Id: Id68eea4a004788751404d70567222a2c531578aa Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/accessible/itemviews.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/widgets/accessible/itemviews.cpp b/src/widgets/accessible/itemviews.cpp
index 5a7fdf9a03..677e56806a 100644
--- a/src/widgets/accessible/itemviews.cpp
+++ b/src/widgets/accessible/itemviews.cpp
@@ -1035,10 +1035,14 @@ QAccessible::State QAccessibleTableCell::state() const
st.selected = true;
if (view->selectionModel()->currentIndex() == m_index)
st.focused = true;
- if (m_index.model()->data(m_index, Qt::CheckStateRole).toInt() == Qt::Checked)
+
+ QVariant checkState = m_index.model()->data(m_index, Qt::CheckStateRole);
+ if (checkState.toInt() == Qt::Checked)
st.checked = true;
Qt::ItemFlags flags = m_index.flags();
+ if ((flags & Qt::ItemIsUserCheckable) && checkState.isValid())
+ st.checkable = true;
if (flags & Qt::ItemIsSelectable) {
st.selectable = true;
st.focusable = true;