Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.7.1
-
None
Description
STEPS LEADING TO PROBLEM:
Attached a test application which basically does the following:
1. Create QTextDocument
2. Add multiple lines of text, separated by LF (\n)
3. Use QTextDocument::documentLayout()->hitTest(pos, Qt::FuzzyHit) to find
cursor position in different y coordinate values. Let x be constant 1.
EXPECTED OUTCOME:
Returned cursor position should indicate place close to actual hit point.
ACTUAL OUTCOME:
With a hitpoint in between lines the returned cursor is at the end of row, even
if x coordinate would be at the beginning of row (e.g. x=0.0).
In practise this behaviour can be seen in touch screen device so that even if user moves finger vertically in left edge of left-aligned text edit, cursor sometimes jumps to right side, in the end of row. Also by tapping just in the middle between lines(doesn't matter what x coordinate is) causes cursor to appear at the right side of the text.