PDA

View Full Version : QTextDocument dynamically removing resources



lukass
27th October 2010, 15:57
Hello.

I insert image to QTextEdit:

ui.textEdit->document()->addResource(QTextDocument::ImageResource, url, img);
QTextImageFormat imageFormat;
imageFormat.setName(url);

ui.textEdit->textCursor().insertImage(imageFormat);
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)?