Hello,

i want to play a little bit with the svg functions, but i have several problems. I hope someone can clear this

1.) When drawing various types on the QGraphicsScene e.g QGraphicsRectitem, .... and save this as an svg file:
Qt Code:
  1. QSvgGenerator generator;
  2. generator.setFileName(file.fileName());
  3. generator.setSize(QSize(width+20, height+20));
  4.  
  5. QPainter painter;
  6. painter.begin(&generator);
  7. scene()->render(&painter, QRectF(0, 0, width+10, height+10), QRectF(minX-10, minY-10, width+20, height+20));
  8. painter.end();
To copy to clipboard, switch view to plain text mode 
how can i add element id's?
2.) When i load an existing svg file, how can i get a list of available element id's. Here i want do create a QGraphicsSvgItem for each element, so i can modify it in the graphicsscene.
3.) Is the way to draw svg graphics correct (Question 1)

Thanks in advance

Best Regards
NoRulez