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. QSvgRenderer incorrectly renders "Inkscape" SVG files
Forum Updated to NodeBB v4.3 + New Features

QSvgRenderer incorrectly renders "Inkscape" SVG files

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 3.1k 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.
  • C Offline
    C Offline
    Code_ReaQtor
    wrote on last edited by
    #1

    Greetings!

    I have an app which loads SVG files using QGraphicsView/Scene + QGraphicsSvgItem + QSvgRenderer. My app seems working with basic SVG files but when I load an "Inkscape" SVG file (with multiple items/shapes within it), it incorrectly renders them (there are black regions which are supposedly be "texts" and shapes/etc are not found in the right place). I am using Inkscape to create SVG files. I tried to use IE to check if the files are corrupted but it renders them correctly. I also used the SVG files in the "Inkscape tutorial" with NO success.

    Is this a bug in the QSvgRenderer? are there any other alternatives?

    Thanks and more powers!

    Please visit my open-source projects at https://github.com/Code-ReaQtor.

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      q8phantom
      wrote on last edited by
      #2

      Are you converting these to an image

      this is not related but it might help a little bit

      http://stackoverflow.com/questions/8551690/qt-how-to-render-scaled-svg-to-qimage

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #3

        QtSvg module uses SVGtiny specification only, it does not support full SVG standard, and is known to have numerous bugs.

        Current recommendation is to use QtWebKit for rendering non-trival SVG files.

        (Z(:^

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Code_ReaQtor
          wrote on last edited by
          #4

          Thanks sierdzio. That could be the problem with QSvgRenderer.

          Are there any alternatives? third party maybe? or any links on how i can modify QSvgRenderer (I learned that the devs deprecated the library)?

          Please visit my open-source projects at https://github.com/Code-ReaQtor.

          1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            QtWebKit. There sure are other renderers, but I don't know them. Check inkscape, it probably uses some GTK stuff.

            (Z(:^

            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