Hi all

I have a QTextEdit control filled by a custom object instead of standard letters. For insert object I got the example from qt package as follow:

Qt Code:
  1. QTextCursor cursor = textEdit->textCursor();
  2. cursor.insertText(QString(QChar::ObjectReplacementCharacter), MyCharFormat);
  3. textEdit->setTextCursor(cursor);
To copy to clipboard, switch view to plain text mode 

It word very well. Now I want to activate the mouse cursor tracking for the editor and get the object currently under the cursor. I use a code similat to the following:

Qt Code:
  1. int textCursorPosition = document()->documentLayout()->hitTest( event->pos(), Qt::FuzzyHit );
To copy to clipboard, switch view to plain text mode 

This function will return the cursot position of the object under the mouse pos but, once got this coordinate, how to get the pointer to my custom object structure? In case of standard letter I could use the following code:

Qt Code:
  1. QChar character( textDocument->characterAt( textCursorPosition ) );
To copy to clipboard, switch view to plain text mode 

But what about custom object?

Thank you