Check the implementation of drawCursor(), maybe it does some painter transformations prior to drawing the cursor. Maybe this will fix the difference between your line and drawCursor(). If the line itself is at a wrong position then I'd assume your earlier calculations don't take some aspect into consideration. Check the source code for QLineEdit again and see if you didn't miss something.
Bookmarks