Congratulations to our 2022 Qt Champions!

[Solved] SVG displays stippled areas instead of solid

  • When using a QWebView to display svg files with opacity values, they are drawn with a stippled pattern. The same files in Safari and Firefox show up as expected. How can I get this to render without stippling?

    Here is a file that shows the problem:


    With stippling, the text becomes unreadable. I tried setting the palette brush but it doesn't seem to work (unless I'm doing something wrong).

  • hi ggendel, can you markup that link

  • I checked with FF and with Qt webkit loading this in a QWebview, and the svg seems similar. Can you create a smaller svg file and post here that can show this difference you are mentioning?

  • Chetan,

    Thanks for looking at this. I've been pulling my hair out on this one. I put two image grabs from a piece of the result of the svg rendering to demonstrate what I'm seeing:


    They can be found in "":

    BTW, I'm currently working with Qt-4.5.3 if that helps.


  • Ah, now i see what you mean, the rendering seems totally different on Qt Webkit.
    But, I'm on Qt 4.7.0 and on Winxp and do not see any difference between FF and Qt webkit. Feasible for you to take latest version of Qt and check this out?

  • Chetan,

    Thanks for bearing with me. I tried 4.7.0 with exactly the same result. I packaged up a test rig with the class I'm using and put it on the website as "tstSvg.tar.gz". We use "jam" and have a modular rules setup so I took the system commands from the actual build and put it in the "build.txt" file. You should be able to modify this file to build it on your platform, but the Jamfile is pretty easy to understand if you want use it to make a .pro file instead.

    You'll also need to change the hardcoded path to the svg file in tstSvg.cpp. The entire code is just over a page long so I don't expect anything there to surprise you.


  • I tried again with your code and it just works !
    Not sure if this is something related to graphics driver on your box and Qt facing issue with it? Can you try this on a different computer? (guess based on "this": thread)

  • Chetan,

    I'm coming to the same conclusion. I saw an application note that Qt relies on the underlying capabilities of the X-server. This means if I don't have the proper render extension library it will cause this stippling pattern.

    Thanks for all your assistance.


  • you are welcome and let us know if it worked :)

  • I tried it on OpenSuse 11.3 and it looks great so it looks like the problem is OpenSuse 10.3.

  • I also have no problem, you probably has missing extension on your X server.
    You can try the graphicssystem raster, it avoids lots of problems of X11.

  • [quote author="Benjamin Poulain" date="1289218305"]I also have no problem, you probably has missing extension on your X server.
    You can try the graphicssystem raster, it avoids lots of problems of X11.[/quote]

    Thanks... Works like a charm. I'll have to play around to see if this option causes any side-effects to other widgets.

Log in to reply