-1

Is it possible to render svg from svg paths?

Like in JavaScript, we are having Path2D to render svg paths to canvas. Similarly, Is there any way to render a svg path to the QGraphicsScene?

BladeOfLightX
  • 504
  • 4
  • 17

1 Answers1

0

You can use QGraphicsSvgItem to put an SVG onto a QGraphicsScene. It

  • can be constructed directly from an SVG-file
  • allows to restrict rendering to a certain ID within the SVG-data (if you only want to render a small subset of a large file)
  • can connect to a QSvgRenderer

The last option is useful if you have no file but rather raw SVG-data in a buffer, i.e. received via a network connection or created dynamically from user input.

SebDieBln
  • 3,303
  • 1
  • 7
  • 21