I have QTextEdit with richtext and embedded images in it. In mousePressEvent I need to know which image is under cursor. Are there any way to achieve it ?

I've tried cursorForPosition(e->pos()).charFormat() but it gives the image which will be just before text cursor if I'll click at the e->pos() position, which is not what I want. I want behavior like anchorAt() but for images.