[Development] Proposal: expose accessibility group position (PositionInSet / SizeOfSet) via Qt on Windows

Michael Weghorn m.weghorn at posteo.de
Mon Dec 22 09:53:33 CET 2025


Hi,

On 2025-12-16 16:01, Volker Hilsheimer via Development wrote:
>> On Windows, screen readers rely on UI Automation properties such as PositionInSet, SizeOfSet, and Level to announce group position information (e.g. “option 1 of 4”). With our current setup, this information is not exposed via Qt’s accessibility layer, so screen readers lose this context in grouped controls (radio button groups, menus, lists, etc.).
>>
>> I have a prototype implementation for Qt 5.15.x that provides this information via Windows UIA. Before turning it into an upstream contribution, I’d like to ask:
>> - Is this feature something the Qt project would be interested in supporting?
>> - If yes, is there a preferred API/design approach for implementing it?
>> - Should I first file a Jira issue, and if so, under which component?
>>
>> 
> [...]
> Thanks for spotting this! Supporting this part of the UI Automation interface would indeed be interesting for our integration in Qt. I assume this can be implemented with the existing hierarchy-traversal APIs, although finding the position of a specific interface within its parent might be a comparatively expensive operation in very large lists (for instance in a tree view).
> 
> A Jira ticket that documents what the expected outcome should be for different controls would be great; i.e. is “Level” something that we should expect from nested group boxes, or only from nested menus? The component for accessibility issues is “GUI: Accessibility (a11y)”.
> 
> Given that you have a working implementation for UI Automation, it’s probably best to discuss possible approaches based on the existing patch. One thing to consider is whether this can/should be implemented across platforms, but that depends on whether the native a11y infrastructure on other platforms have that feature in the first place, or whether they use (or fall back to) existing tree-navigation infrastructure to get this information.

As far as I can see, all of the mentioned UIA properties have an 
equivalent in ARIA, see [1]:

* PositionInSet: "aria-posinset"
* SizeOfSet: "aria-setsize"
* Level: "aria-level"

As such, I think they're likely relevant for all platforms, not just 
UIA/Windows.

Using the existing QAccessibleAttributesInterface [2] could be a 
potential way to implement support, by adding corresponding values to 
the QAccessible::Attribute enum [3] and then handling those in the 
relevant widget a11y implementations.

For Level/"aria-level", there already is `QAccessible::Attribute::Level`.

Commit [4] added some initial mapping for UIA. As far as I can see, 
UIA_HeadingLevelPropertyId isn't handled in the UIA bridge yet, but that 
should be relatively straight-forward to add.
More attributes could probably be handled similarly there (and in other 
platform bridges, where applicable).

In case of taking that approach, the corresponding logic for reporting 
these attributes could then be done in the a11y implementations of the 
corresponding widgets and be cross-platform.

Regards,
Michael


[1] 
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes
[2] https://doc.qt.io/qt-6/qaccessibleattributesinterface.html
[3] https://doc.qt.io/qt-6/qaccessible.html#Attribute-enum
[4] 
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=bd0a6e83079efd8a26d9ece6055f584a8c89c1fd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.qt-project.org/pipermail/development/attachments/20251222/8214ba8c/attachment-0001.sig>


More information about the Development mailing list