attaching a QwtPlotSvgItem to a plot does not work
Code:
//...
// https://upload.wikimedia.org/wikipedia/commons/0/02/SVG_logo.svg
if (!bla.
loadFile(QRectF(0,
0,
640,
480),
"e:/SVG_logo.svg")) qDebug("fail to load?");
else
qDebug("load OK");
bla.attach(myPlot);
Also a stripped down svg fails:
Code:
<?xml version="1.0" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" viewBox="0 0 100 100">
<rect
id="background"
fill="#FF9900"
width="100"
height="100"
rx="4"
ry="4"/>
</svg>
Fails means: it is not displayed. It loads fine (true is returned).
Re: attaching a QwtPlotSvgItem to a plot does not work
Can you load your SVG into the svgmap example ?
QwtPlotSvgItem is for scaling a SVG into a specific area in plot coordinates. In your case you have set ( 0, 0, 640, 480 ) - what might be wrong as it sounds like being screen/widget coordinates.
If you want to display a SVG at a specific position you can use a QwtSymbol in combination with a curve or marker. In this case the size of the SVG is independent from the scales.
Uwe