It would be difficult with a picture, that's why I wrote a small program, but the problem is this: The cursor (the red vertical line) isn't rendered where you click the text. Also, trying to move the cursor with the left and right keys makes the cursor jump several characters and it never goes where it's supposed to.

It's as if QLineEdit::cursorPosition() doesn't return the correct value, but it does as far as I can tell. For some reason QTextLayout::drawCursor() doesn't render the cursor properly.