[PyQt] PyQt, QWebView, SVG Rendering Problem

Christoph Burgmer chrislb at gmx.de
Sat Jan 24 04:59:26 GMT 2009


Am Saturday, 24. January 2009 schrieb David Boddie:
> On Fri Jan 23 12:47:29 GMT 2009, Atul Kulkarni wrote:
> > I have a problem of rendering SVG Images in QWebView. The SVG Images are
> > replaced with missing image icons ("?"). I am inserting a simple SVG
> > image in an XHTML document.
>
> This is a common problem with most Web browsers because SVG support is not
> as widespread as it would ideally be. Does the page appear as it should do
> in other browsers?
>
> > Can any one help me resolve this problem. I would really appreciate any
> > help or direction.
> >
> > My System and File details as follows:
> > OS - Windows XP
> > Python 2.5
> > PyQt4.4.3 with Qt4
> > Using Qt Designer 4.4.1 Open Source Edition
> > My PyQt4 plugins has imageformats with qsvg4.dll, qsvgd4.dll
>
> I don't think that Qt's support for SVG will make any difference here
> because WebKit is doing the rendering. I don't know what features WebKit
> has for embedding SVG 1.1 drawings into pages, but it seems to be able to
> display them (Qt 4.4.3, PyQt 4.4.4, Linux) if you pass the URL to the
> SVG itself to QWebView's load() method.
>
> In fact, it seems that they can also be embedded into the page. The
> following simplified XHTML markup worked for me:
>
> <!DOCTYPE html PUBLIC
>   "-//W3C//DTD XHTML 1.0 Transitional//EN"
>   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
>       xmlns:svg="http://www.w3.org/2000/svg"
>       xmlns:xlink="http://www.w3.org/1999/xlink" lang="en">
> <head>
>   <meta http-equiv="content-type"
>         content="application/xml+xhtml; charset=UTF-8" />
>   <title>SVG Test</title>
> </head>
> <body>
> 	<p>I am Object showing SVG</p>
> 	<object data="test_svg.svg" type="image/svg+xml" height="170" width="325">
> 		Your Browser does not support SVG
> 	</object>
> </body>
> </html>

It doesn't work for me with PyQt 4.4.2. I'm using setHtml() not load().
I can currently not update to a newer version, so I cannot verify if that is a 
issue in 4.4.2 solved in 4.4.3.

Christoph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090124/539d789b/attachment.html


More information about the PyQt mailing list