Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Get a shape from an SVG ?
Qt 6.12 LTS is out! See what's new in the release blog

Get a shape from an SVG ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 1.7k Views 2 Watching
  • 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.
  • A Offline
    A Offline
    Adam Crowe
    wrote on last edited by
    #1

    Hello!

    I have a custom QGraphicsObject control which draws a shape from an SVG file. This works wonderfully except that I also implement the hover events which although also work, I'm having trouble with getting the shape out this SVG file without having to manually recreate its path and returning it in the shape() override.

    I'm sure it's asking a lot, but is there a way out there to get a QSvgRenderer to return the file's outer path? Something simple like:

    QPainterPath path;
    
    path.addPolygon(mySvgRenderer->getPolygonShape());
    
    return path;
    

    Life can't be that simple, right…?

    Best Wishes,

    Adam

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DDraw
      wrote on last edited by
      #2

      No answers?

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        @Adam-Crowe said in Get a shape from an SVG ?:

        is there a way out there to get a QSvgRenderer to return the file's outer path?

        No.

        1 Reply Last reply
        1

        • Login

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