Groups when exporting to SVG

Issue #884 closed
Ronan Le Tiec created an issue

When exporting a pattern to svg, it would be useful if all elements that belong to a piece would be in the same group.

My Use Case: To achieve the desired placement of the pattern pieces on an A0 sheet of paper, I export the pattern pieces to SVG and open the file in InkScape. I then place them manually. The cutting and seam line of a piece are not in the same group of (or attached to) all the elements of the piece (like labels, internal path, grainline). So when I want to move a piece around, I first need to select all the elements of the piece and group them.

Do you think it's possible to achieve this when exporting? If you point me in the right direction I could try implementing it myself.

Comments (3)

  1. Roman Telezhynskyi repo owner

    Do you think it's possible to achieve this when exporting? If you point me in the right direction I could try implementing it myself.

    First of all we do not control how we export to SVG. We do this through QGraphicsScene and QSvgGenerator. If you still can confirm that some objects grouped and some are not, this means we have a chance. And we can try to improve how we create a piece item on scene. And this happens here VLayoutPiece::GetItem(). If setting parent/child relation will be ignored by QSvgGenerator there is no way. At least no easy way. Because you need either tweak QSvgGenerator or create your own QPaintEngine like i do with DXF support.

  2. Ronan Le Tiec reporter

    The cutting line and the seam line of a piece belong together, but I think they belong to the same path and are not separate objects. Ok, when I have some more time I'll investigate and see if I can do something about it.

  3. Log in to comment