From 02fc1481adc68fcf8ae19d3703e2ba35e0ebe92e Mon Sep 17 00:00:00 2001 From: Reza Bakhshi Laktasaraei Date: Thu, 3 Sep 2026 07:09:29 +0330 Subject: [PATCH] Name a checkbox without a label by its accessible name The name of a checkbox for a screen reader is its label, and a checkbox created without one - beside a poll answer, where the answer stands for the label - had no name at all, with no way to give it one. Fall back to the widget's accessible name when the label is empty. --- ui/widgets/checkbox.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/widgets/checkbox.h b/ui/widgets/checkbox.h index d3516297f..7b6f7ca1a 100644 --- a/ui/widgets/checkbox.h +++ b/ui/widgets/checkbox.h @@ -209,7 +209,11 @@ class Checkbox : public RippleButton, public ClickHandlerHost { return QAccessible::Role::CheckBox; } QString accessibilityName() override { - return _text.toString(); + // A checkbox with no label of its own - beside a poll answer, in a + // list row - is named by what stands for it, through the widget's + // accessible name. + const auto text = _text.toString(); + return text.isEmpty() ? RpWidget::accessibilityName() : text; } AccessibilityState accessibilityState() const override; void accessibilityDoAction(const QString &name) override;