I'm using QWebKit to render a a pdf-page. Untill now, I used setHtml(), to feed the html code to the QMainFrame and then render() to print the content or export it to pdf. So far so good, but I want to use setContent() to include inline-svg-images to the frame, which get not displayed, using setHtml().

But setContent() only accepts QByteArray, and the html-Code is in unicode. How do I feed the unicode string to setContent()?

有帮助吗?

解决方案

The way to get a byte array out of a unicode is to encode it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top