summaryrefslogtreecommitdiffstats
path: root/src/tools/qdbusxml2cpp
diff options
context:
space:
mode:
authorBoris Dušek <me@dusek.me>2014-12-28 23:38:38 +0100
committerBoris Dušek <me@dusek.me>2015-02-12 18:29:42 +0000
commit07cd153c7e9382d4c0fed29cf6682f7d0a37645b (patch)
treeeabeece73b43d8ea50d777f1c44b494c0d72672f /src/tools/qdbusxml2cpp
parente82d3b1a1e7fce907fa673f0a4040008e95bf019 (diff)
Fix accessibility lines on OS X
Make QTextView accessibility on OS X mirror that of NSTextView in terms of translating between positions and line numbers. Most significantly, we report softlines (i.e. "lines" resulting from visual wrapping induced by text view's width) as individual lines, not just hardlines (i.e. "lines" delimited by newline characters, a.k.a. paragraphs). This fixes keyboard echo when using just arrow up and down (without VO prefix) as now in such case VoiceOver reads the softline that the text cursor moved to; before this fix it read again the whole paragraph (which it read no matter to which softline of paragraph we moved to). This enables the user to search more effectively for the softline they need (which they do very often when navigating text). Further, we changed the behavior to report the trailing newline character of a line as the last character of the line. This is consistent with how NSTextView (and TextEdit) does things (and makes the newline character be displayed on a braille display for the user to be able to distinguish that this is really the end of paragraph), but could be debated and changed as some important Apple apps do not include the newline character in the line range (most notably Pages and Mail, both in the document (or email text) text area). I asked about this here: http://lists.apple.com/archives/accessibility-dev/2015/Jan/msg00000.html This also fixes the case where empty line previously returned empty range (length == 0) for AXRangeForLine and VoiceOver interpreted that as end of document even if it was in the middle of document (e.g. in examples/widgets/richtext/textedit, there is an empty line in "Lists" section just before the last paragraph, if one attempted to move past it e.g with VO-arrow down after interacting with the text using VO-Shift-arrow down, then no luck). The code is currently O(N) as the previous one, which could mean a performance problem for bigger documents. As it seems QTextLayout has all the information it needs to do AXLineForIndex and AXRangeForLine efficiently (I would presume O(log N)), this should be eventually rewritten to take advantage of that (but the required interfaces are not currently exposed through QAccessibleTextInterface) [ChangeLog][QtGui][Accessibility][OS X] QTextEdit now properly reports to accessibility visual lines (softlines) as lines, instead of whole paragraphs. This allows better VoiceOver user experience when reading text line by line using arrows up/down. Change-Id: Ie7f06eb919de31d0a083b3b30d26ccac4aa27301 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'src/tools/qdbusxml2cpp')
0 files changed, 0 insertions, 0 deletions