[Interest] QSvgWidget distorts my SVG

Shriramana Sharma samjnaa at gmail.com
Sun Aug 19 14:56:12 CEST 2012

Hello. I'm using Qt 4.8.1 (4.8.1-0ubuntu4.2 to be precise) on Kubuntu Linux.

The attached program demonstrates what seems to be a bug in the
behaviour of QSvgWidget i.e. that it distorts the SVG rendering
according to its (i.e. the widget's) size. This makes QSvgWidget
unusable for general-purpose rendering of SVGs. Is my program supposed
to be able to read the SVG code itself and determine its
size/proportions without depending on Qt to do what is needed? I can't
throw any valid SVG code at QSvgWidget and expect it to render it
without distorting it?

The documentation says: "Since QSvgWidget is a subclass of QWidget,
SVG drawings are rendered using the properties of the display." But I
am not sure how this is supposed to mean that the picture represented
by the SVG is potentially distorted while being displayed...

I am using QSvgWidget in my program to display SVG code output by a
drawing library (as I have mentioned in other threads). But now I find
that the SVG is displayed distorted! :-(

I should note that in my program each time the user presses the
Execute button (to execute the drawing commands the user inputs), the
produced SVG code can change, and I want to reuse the same QSvgWidget.
Can I do this or not?


Shriramana Sharma
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qsvgwidget-bug.cpp
Type: text/x-c++src
Size: 1152 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120819/d1f49555/attachment.cpp>

More information about the Interest mailing list