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:
QSvgGenerator generator;
generator.setFileName(file.fileName());
generator.
setSize(QSize(width
+20, height
+20));
painter.begin(&generator);
scene
()->render
(&painter,
QRectF(0,
0, width
+10, height
+10),
QRectF(minX
-10, minY
-10, width
+20, height
+20));
painter.end();
QSvgGenerator generator;
generator.setFileName(file.fileName());
generator.setSize(QSize(width+20, height+20));
QPainter painter;
painter.begin(&generator);
scene()->render(&painter, QRectF(0, 0, width+10, height+10), QRectF(minX-10, minY-10, width+20, height+20));
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
Bookmarks