Inline SVG support in QtWebKit embedded



  • Hi,
    I've cross-compiled Qt 4.7.3 to an ARM board (mini2440). And when I try to load html page with inline SVG graphics, using simple QWebView project, all I get is blank screen. Rendering SVG images directly works correctly so SVG support isn't the problem.

    Is this a limitation of embedded QtWebKit or have I configured my environment wrongly?

    My embed Qt configuration: %./configure -embedded arm -xplatform qws/linux-arm-g++ -prefix /usr/local/arm/Qt -qt-mouse-tslib -little-endian -nomake examples -nomake demos%



  • I had a similar issue which was present even in the stock "previewer" example. The issue seems to be related to the implicit text/html MIME type used by QWebView's setHtml function. Comments on "Bug 31115":https://bugs.webkit.org/show_bug.cgi?id=31115#c0 suggest deprecating setHtml because of this potential confusion.

    The workaround, as suggested in this "bug report":http://doc.qt.nokia.com/stable/examples-webkit.html, use setContent instead.

    bq. @webView->setContent(html.toLocal8Bit(), "application/xhtml+xml");@

    Works great. With the obvious catch that the document must be formatted in XHTML.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.