Skip to content
Commit e1f59f5b authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Explicitly set cursor position as workaround for event order problem

If a line edit gets focus and there is no selection, then the line edit
selects all text. If an empty line edit gets focus for the first time,
then selecting all text triggers a cursor changed signal and an
accessible text cursor event. By this time, the line edit is already
set as focus widget, but the accessible focus event has not yet been
sent.
orca sets the line edit as locus of focus when it receives a text cursor
event for an item with the focused flag. This makes orca ignore the
focus event following the text cursor event, so that the newly focused
line edit is not announced to the user. This might be considered bug in
orca, but maybe other screen readers behave similarly.
Explicitly setting the cursor position to 0 prevents the emission of the
accessible text cursor event when the line edit gets the input focus
(because Qt doesn't emit this event twice for the same cursor position),
so that orca properly announces the line edit....
parent 5df7ff9e
Pipeline #208846 passed with stage
in 2 minutes and 13 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment