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. Get a shape from an SVG ?
Forum Updated to NodeBB v4.3 + New Features

Get a shape from an SVG ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 884 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 Extensions
        • Unsolved