PDA

View Full Version : Export SVG: Qwt Bug?



giusepped
18th December 2008, 07:42
I think there is a bug, which is easily checked by using the bode example.

If you put his line in the constructor of bode_cpp


setAxisScale(QwtPlot::yLeft,0,40);

by forcing the y scale to be from 0 40, and if you then export in SVG,
you will see that the plot is painted outside the canvas in the svg file.
It seems that values behond the limit set by setAxisScale() are handled in the wrong way.
Uwe, do you agree?

giusepped
19th December 2008, 04:44
Nobody checked this error? It is very important to get svg file in the correct form....
G

Uwe
19th December 2008, 09:44
Looks like the svg paint engine ignores clipping at all. Looking into Qt 4.5.0 beta I can't see any new code, so it doesn't seem to be on the TODO list of the Qt developers.

If you enable QwtPlotCurve::ClipPolygons, the curves are clipped against the paint device boundaries ( QPainter::window() ). Then you have to patch qwt_plot_curve.cpp, so that the canvasRect is used instead of painter->window().

Uwe

giusepped
19th December 2008, 11:43
Why not submitting a patch to Qwt in the subversion ?
G

giusepped
19th December 2008, 11:50
Moreover, for me is quite hard to understand where to patch...may you be more detailed...?
G