You can't append to an HTML file because it must end with the </html> tag.
Maybe if you have the current HTML stored somewhere you can remove the </html> tag, append HTML code, and then append "</html>"?
thrall (5th November 2010)
I hoped QWebView would provide something like that.
Now I have decided to write my own class, derived from QWebView, storing the content in local QString member variable and setting the content after change in QWebView. The should be very easy ;-)
However, I would like to make shure that the resulting document is a vaild html format. Can someone suggest an small and lightwight (free) html checker, available as library or source?
You can do it using the easy way:
webView->page()->mainFrame()->evaluateJavaScript("document.body.innerHTML += [your code]");
Using scripts you can dynamically "talk" with the HTML DOM.
in the [your code] i'm using a "window.bridge.code" with addToJavaScriptWindowObject.
But you can simples put your text there, or use "document.body.innerHTML += '" + code + "';";
^^
Bookmarks