summaryrefslogtreecommitdiffstats
path: root/src/widgets/accessible
diff options
context:
space:
mode:
authorHarald Sitter <sitter@kde.org>2023-01-24 13:02:28 +0100
committerHarald Sitter <sitter@kde.org>2023-03-01 22:05:23 +0100
commit5317ff74fd2ff31e4bfb8e7e6c4a6e06a16fffc8 (patch)
tree9d2c893a0ab1ae7d20fa59f51858194de1c544cb /src/widgets/accessible
parent79578fd691820aad2c9be3827c376c62c182bb14 (diff)
a11y: even checkable buttons are pressable
otherwise there is no way to synthesize a "click" through the a11y API. toggleAction only leads to a toggled() signal but the user may be more discerning and only listen to clicked() (or QAction::triggered) to react to **user** events not all toggle events. as such pressAction is always superior to toggleAction when user input is meant to be synthesized through a11y tooling. Change-Id: I7f024d57087b545d3cfd1805026ea538b0b3e166 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/widgets/accessible')
-rw-r--r--src/widgets/accessible/simplewidgets.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/widgets/accessible/simplewidgets.cpp b/src/widgets/accessible/simplewidgets.cpp
index da4566bfff..fbbbab857d 100644
--- a/src/widgets/accessible/simplewidgets.cpp
+++ b/src/widgets/accessible/simplewidgets.cpp
@@ -216,11 +216,9 @@ QStringList QAccessibleButton::actionNames() const
names << toggleAction();
break;
default:
- if (button()->isCheckable()) {
+ if (button()->isCheckable())
names << toggleAction();
- } else {
- names << pressAction();
- }
+ names << pressAction();
break;
}
}