Hey Y'all,
What is the proper order to load an svg file then draw and attach it as a QwtSvgPlotItem onto a QwtPlot?
I am trying to draw a SVG to QwtPlot by using a QwtSvgPlotItem. I've loaded the SVG onto various QPainterDevices (QPixmap, QSvgRenderer, QIcon) and applied them onto QPainter without visual success each time. The file is properly loading and there are no errors, so it has to be in my procedure.Now I need to draw it, then attach it to the plot. Below is skeleton code of the order I have been working under should be done. Is it correct or is this backend developer missing something fundamental to frontend design?
QwtPlotSvgItem.loadFile(boundRect, svgAbsolutePath);
QPainter painter(&QPaintDevice);
planeSVG.draw(&painter, xScale, yScale, boundRect);
QwtPlotSvgItem.attach();
or
QwtPlotISvgItem.loadFile(boundRect, svgAbsolutePath);
QSvgRenderer renderer(svgAbsolutePath);
QPixmap pm(200,200);
QPainter painter(&pm);
renderer.render(&painter, pm.rect());
QwtPlotSvgItem.draw(&painter, xScale, yScale, boundRect);
QwtPlotSvgItem.attach();
Any insight is greatly appreciated
Sincerely,
Me
Bookmarks