Quote Originally Posted by llev View Post
Try the following:
Qt Code:
  1. int docLPos = m_Edit->document()->documentLayout()->hitTest( QPointF( ptViewport.x(), ptViewport.y() ), Qt::ExactHit );
To copy to clipboard, switch view to plain text mode 
Thanks for the reply and my apologies for the delay in acknowledging it: the project has been suspended and I completely forgot about this pending issue.

I was aware of the hitTest() function, but I assumed it was working the same as cursorForPosition() (oh, never, never assume anything!), so I did not even tried it.

When finally answering your post, in order to give a complete reply as possible, I tried it and, lo!, it works indeed!.

So, thanks for overriding my stubborness!

M.