Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Selective layer rendering of an svg file with a QGraphicsSvgItem
Forum Update on Monday, May 27th 2025

Selective layer rendering of an svg file with a QGraphicsSvgItem

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 501 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tomvl
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved