Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.4.2, 6.5.0 Beta2
-
None
Description
When a button is checkable, VoiceOver on macOS doesn't press it and just toggles its state. Instead, it gets toggled without emiting a "pressed" signal. Buttons that can't be checked work fine.
Digging through the code, I found that QAccessible treats any buttons that are checkable as CheckBoxes, while usually they really look and function like buttons. This means that VoiceOver will say "You're now on check box" instead of "You're now on button", and when getting the NSAccessibilityPressAction Qt translates it to a
QAccessibleActionInterface::toggleAction.
Given how consistent this behavior (treating checkable buttons as checkboxes) is all over the QAccessible I wonder if I missed something in the documentation or when reading other issues, but everywhere it sounds like the pressed signal would still be intended to fire.
I have added a minimal sample to reproduce this (use VoiceOver to press either button and check the console for output). It just requires two checkboxes, one of which would be checkable and the other not.
I also attached a hacky diff, applying which alleviates the issue on my side. It's mostly there to point out potentially relevant code paths where checkable buttons are treated as checkboxes, but it shouldn't be treated as a real fix (since it's otherwise untested and the current behavior looks so oddly intentional in code).