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. SVG (scalable vector graphic) rendering [solved]
Forum Updated to NodeBB v4.3 + New Features

SVG (scalable vector graphic) rendering [solved]

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.4k Views 1 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.
  • H Offline
    H Offline
    heliosbird
    wrote on last edited by
    #1

    Hello,

    I would like to display an SVG image that I created in visio. I can open it in IE, gimp and inkscape successfully, but when I try to display it in my Qt program, I get a very strange rendering. I tried saving the file using inkscape, but it was the same problem.

    This is my source code:
    @ QLabel* graphic = new QLabel();
    QIcon svgImage(":/Resources/visio.svg");

    graphic->setPixmap(svgImage.pixmap(1000,1000));@
    

    "Here is a link to the displayed SVG":http://imgur.com/DVLIQ7s

    Does anyone have any suggestions on how to fix this? Thanks! I don't need to use a QLabel, and I can even use a different image format (but preferably one that makes it easy to maintain text legibility).

    Thanks!

    Solution: Instead of opening the svg created by visio and resaving, I copied the Visio objects and pasted them into a new file in inkscape. I saved them as an (inkscape SVG). This svg format worked.

    1 Reply Last reply
    1
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      IIRC, you'll need to use Qt's SVG module to do that. It might be too limited depending on which version of SVG you are using.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • H Offline
        H Offline
        heliosbird
        wrote on last edited by
        #3

        [quote author="SGaist" date="1389042714"]Hi,

        IIRC, you'll need to use Qt's SVG module to do that. It might be too limited depending on which version of SVG you are using.[/quote]

        Thanks! I use the module successfully for graphics I made in GIMP, but unfortunately the visio image does not render as expected. I suspect you are correct that it might be too limited.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          IIRC QtSvg supports the static features of SVG tiny 1.2

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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