Hello,
is it possibile to pass to setHtml() a string with a self-contained image? I know I can do the following:
Qt Code:
QString html; html.append("<img src=\"c:\\temp\\sample.png\">"); myTextEdit->setHtml(html);To copy to clipboard, switch view to plain text mode
and it works. However, I would like to get rid of the external image file (I am generating it at runtime).
My first attempt was to build the html incrementally by repeteadly calling QTextEdit::insertHtml() and QTextEdit::insertImage(), but that messes things up. I guess that's because I am generating the html by recursion (visiting a tree), so the "start" and "end" tags are usually separated by many calls to "insertHtml()", and formatting gets lost in the way.
I also tried to encode the images in the html using some "base64" encoding snippet found on the net, but it doesn't work.
Thanks
Qt 4.5.1, Vista Sp1, VS Express 2008
Bookmarks