PDA

View Full Version : QSvgRenderer and 'pattern' element



prof.ebral
23rd November 2012, 02:43
I have a grid based map system and I would like to convert the grid lines into Svg so they don't disappear as the end user zooms out of the map. I was looking at QSvgRenderer but it does not appear to support the 'pattern' element. The problem stems from the inabilty to find the pattern "url" as referened by the given ID od the 'pattern'. I am currently using PyQt 4.7.3 which supports Qt 4.7 (I think).

Is the problem I am experiencing still persistent in newer versions of Qt?

ChrisW67
23rd November 2012, 05:14
Qt implements the static elements of SVG Tiny 1.2 (http://qt-project.org/doc/qt-4.8/qt4-arthur.html#svg-rendering-support). SVG Tiny only handles solid colour painting (http://www.w3.org/TR/SVGMobile/#sec-gradients).

prof.ebral
23rd November 2012, 13:56
Obviously not the answer I am looking for. :(

Right now I can create a grid that is as large as interger max (width)px x interger max (height)px and because it is a QBrush that paints a QImage as a texture it takes no time at all. Unfortunately the lines don't scale well and some disappear. I've tried with a 128,000 (width)px x 12,800 (height)px map and the result was pretty bad. I attempted with a long list of line elements.

Is the 'pattern' element planned?