feat(accessibility): support SetFocus and Press actions on painted list items#303
Open
rezabakhshilaktasaraei wants to merge 2 commits into
Open
Conversation
c672f53 to
17b275e
Compare
17b275e to
329041b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Painted/virtual list items exposed via
Accessible::Itemadvertise themselves as focusable, but they provided noQAccessibleActionInterface— so a screen reader could neither move focus to such an item (UIASetFocus) nor activate it (UIAInvoke).This makes
Accessible::ItemimplementQAccessibleActionInterface, but only for children whose owner opts in:RpWidget::accessibilityChildSupportsActions(index)(defaultfalse) gates the interface;interface_castreturnsnullptrotherwise, so unrelated painted lists don't advertise no-op Invoke / SetFocus / Select on Windows.actionNames()advertisespressAction(),setFocusAction()(when the row is focusable) andtoggleAction()(when selectable — Qt routes UIASelectionItem.Selectthrough it on the Qt 5 bridge).doAction()routes press →accessibilityChildActivate, focus/toggle →accessibilityChildSetFocus.Actions are dispatched by a stable identity, not by index: the owner provides
accessibilityChildIdentity(index)/accessibilityChildIndexByIdentity(token), and the action virtuals take that token. The owner resolves it to the current row on the main thread, so a reorder or replacement can't make a queued action hit the wrong row. A cached item is also dropped when the row at its index changes identity.All the new
RpWidgetvirtuals default to no-ops / empty, so a widget opts in explicitly (e.g. the chat list).