summaryrefslogtreecommitdiffstats
path: root/src/widgets/accessible/itemviews.cpp
diff options
context:
space:
mode:
authorPiotr Mikolajczyk <piotr.mikolajczyk@qt.io>2020-11-20 15:07:59 +0100
committerPiotr Mikolajczyk <piotr.mikolajczyk@qt.io>2020-12-09 10:52:51 +0100
commit020a6f0daec2e36866888b23c8b3a65bfb366146 (patch)
treebc0b12306b9c71ebcc45ef6e7be6e6851dae979f /src/widgets/accessible/itemviews.cpp
parent6c6e56c42028d5775a977b4be14a243b1d3deb0c (diff)
Android: Qml accessibility fixes
- Accessibility focus can follow the position of the widget (for example when swiping on a scrollview) - controls are clickable directly after appearing on the screen after scroll (previously you had to click somewhere else on the screen, and after that you could focus the newly appeared control) - checkbox and switch react correctly on click action - fixed combobox behavior with accessibility enabled Task-number: QTBUG-79611 Change-Id: If36914ab0165f33593e68fd7ecf168693f8538a7 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit fd20bc2277f98b86bddbd3f8a0ca92457a8c7c70)
Diffstat (limited to 'src/widgets/accessible/itemviews.cpp')
-rw-r--r--src/widgets/accessible/itemviews.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/widgets/accessible/itemviews.cpp b/src/widgets/accessible/itemviews.cpp
index 677e56806a..a7b536ae54 100644
--- a/src/widgets/accessible/itemviews.cpp
+++ b/src/widgets/accessible/itemviews.cpp
@@ -934,10 +934,23 @@ QStringList QAccessibleTableCell::actionNames() const
void QAccessibleTableCell::doAction(const QString& actionName)
{
if (actionName == toggleAction()) {
- if (isSelected())
+#if defined(Q_OS_ANDROID)
+ QAccessibleInterface *parentInterface = parent();
+ while (parentInterface){
+ if (parentInterface->role() == QAccessible::ComboBox) {
+ selectCell();
+ parentInterface->actionInterface()->doAction(pressAction());
+ return;
+ } else {
+ parentInterface = parentInterface->parent();
+ }
+ }
+#endif
+ if (isSelected()) {
unselectCell();
- else
+ } else {
selectCell();
+ }
}
}