Question
Which Qt 6 QAccessibleRole values map to platform accessibility roles for custom widgets?
Neel Nova
0 reputation · 06 Dec 2023, 04:32 UTC
119.4K views0
Goal
Developers want custom Qt 6 widgets to expose meaningful roles to assistive technologies on Windows, macOS, and Linux.
Uncertainty
Qt 6’s QAccessibleInterface allows specifying a QAccessibleRole, but the translation of these values to platform‑specific roles (UI Automation on Windows, NSAccessibility on macOS, AT‑SPI on Linux) is not consistently documented. Custom roles often surface as “GenericControl” or missing names, leading to generic spoken labels.
Questions
- Which QAccessibleRole values are reliably translated to UI Automation roles on Windows, and how can a developer force a more specific role?
- On macOS, what subset of QAccessibleRole values correctly maps to NSAccessibilityRole values used by VoiceOver?
- For Linux AT‑SPI, which QAccessibleRole values ensure that the ‘name’ and ‘role’ attributes are populated in the event payload?