Thank you Lykurg,
it works pretty well! Here is the working code for future reference:
QImage img
("c:\\temp\\sample.png");
// todo: generate image in memory myTextEdit
->document
()->addResource
(QTextDocument::ImageResource,
QUrl("sample.png" ), img
);
html.append("<p><img src=\":sample.png\"></p>");
myTextEdit->setHtml(html);
QString html;
QImage img("c:\\temp\\sample.png"); // todo: generate image in memory
myTextEdit->document()->addResource(QTextDocument::ImageResource, QUrl("sample.png" ), img);
html.append("<p><img src=\":sample.png\"></p>");
myTextEdit->setHtml(html);
To copy to clipboard, switch view to plain text mode
Bookmarks