Skip to content

Report the position of a painted list item within its set - #359

Open
rezabakhshilaktasaraei wants to merge 1 commit into
desktop-app:masterfrom
rezabakhshilaktasaraei:item-set-position
Open

Report the position of a painted list item within its set#359
rezabakhshilaktasaraei wants to merge 1 commit into
desktop-app:masterfrom
rezabakhshilaktasaraei:item-set-position

Conversation

@rezabakhshilaktasaraei

@rezabakhshilaktasaraei rezabakhshilaktasaraei commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

A painted list item had no way to tell a screen reader which of how many rows it is, so the lists that are real widgets say "2 of 10" while the painted ones stay silent about it.

Item reports it now through the accessibility attributes interface, as the PositionInSet / SizeOfSet attributes the Windows UIA bridge maps to the properties a screen reader announces. The numbers come from the owner through accessibilityChildSetPosition(): by default every child is one of the set (index + 1 of the child count), and a list with rows that are not items - a divider between them - overrides it to leave those out, so they neither get a position nor shift the ones below. A row outside the set does not expose the interface at all.

The two attributes are in Qt since 6.13 (https://codereview.qt-project.org/c/qt/qtbase/+/764810), so the Qt 5.15 and 6.11.1 builds need desktop-app/patches#265 to compile.

Used by telegramdesktop/tdesktop#31218 for the message lists. Verified with NVDA on Windows 10: the chat list, the folder tabs, the countries and languages lists and the message lists all announce "n of N" after the row name.

A painted list item reports its "x of y" through the accessibility
attributes interface as PositionInSet / SizeOfSet, which the Windows
UIA bridge maps to the properties a screen reader announces as "2 of
10". The numbers come from the owner through
accessibilityChildSetPosition(): by default every child is one of the
set, a list with rows that are not items (a divider between them)
overrides it to leave them out - such a row exposes no position at all.

The two attributes are in Qt since 6.13; the Qt 5.15 and 6.11 builds get
them through the desktop-app/patches backports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant