Hi there,
Today I was enjoying with Graphics View and SVG. I'm not expert with this framework, so maybe I messed up something
Here's the problem:
i setup a graphic view for svg, with svg renderer and item, but I noticed that - leaving everything untransformed - the edges of my svg shape are cutted off:
http://www.ale-re.net/images/softwares/border-cut.png
the original file was made with inkscape, this one:
http://www.ale-re.net/images/softwares/test.svg

The code is this:
Qt Code:
  1. #include <QApplication>
  2. #include <QSvgRenderer>
  3. #include <QGraphicsView>
  4. #include <QGraphicsScene>
  5. #include <QGraphicsSvgItem>
  6. #include <QBrush>
  7.  
  8. int main(int argc, char **argv) {
  9. QApplication app(argc, argv);
  10. // Create a renderer for this svg file
  11. QSvgRenderer *svgRend = new QSvgRenderer(QLatin1String("test.svg"));
  12. // Create a scene where set things
  13. // Use a custom brush for the background
  14. QBrush bgBrush(QColor(32, 32, 32), Qt::SolidPattern);
  15. scene.setBackgroundBrush(bgBrush);
  16. // Create svg item for the scene
  17. svg->setSharedRenderer(svgRend);
  18. svg->setElementId(QLatin1String("shape"));
  19. // Add the item to the scene
  20. scene.addItem(svg);
  21. // Initialize the view
  22. QGraphicsView view(&scene);
  23. view.show();
  24. return app.exec();
  25. }
To copy to clipboard, switch view to plain text mode 
I tried to translate/scale/rotate the item - if i'm not wrong, these should affect the item matrix, so the item only would change - but no results: the borders still seems cutted.
If you try to add
Qt Code:
  1. svg->rotate(5.0);
To copy to clipboard, switch view to plain text mode 
you can notice that borders are still cutted... It seems that bounding box is calculated without considering borders, so they are cutted.

Any idea?

Thanks very much!

p.s. well, as you can also notice, there is also an issue with text, which isn't put on multi-lines, but this is another issue