Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Selective layer rendering of an svg file with a QGraphicsSvgItem
tomvl last edited by
I have an svg file with multiple layers that I wish to toggle on/off in a Qt app.
Following the black_joker/red_joker example in the Qt documentation I created an QGraphicsSvgItem for each layer, gave it a shared renderer with QSvgRenderer, and assigned it the correct layer Id.
Unfortunately when adding the QGraphicsSvgItem to the scene, the original transformation from the svg seems lost; all layers are drawn around the origin.
Is there any way to keep the original transformation (translation)? Or is there any other way to achieve the effect of selective layer toggling?