Hello.

I insert image to QTextEdit:
Qt Code:
  1. ui.textEdit->document()->addResource(QTextDocument::ImageResource, url, img);
  2. QTextImageFormat imageFormat;
  3. imageFormat.setName(url);
  4.  
  5. ui.textEdit->textCursor().insertImage(imageFormat);
To copy to clipboard, switch view to plain text mode 
where url is unique name and img contain image.

How can I dynamically remove this resource after the user delete image(by normal editing document, eg. by 'Backspace' key)?