Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-8792

QGraphicsSvgItem doesn't handle external references

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 4.6.0
    • SVG Support
    • None
    • Visual Studio 2008, Windows Vista

    Description

      QGraphicsSvgItem can't seem to load referenced SVG documents. When I try to load blue.svg (after unzipping the attached svg_example.zip) in the SVG Viewer sample, I get this on stdout:

      link ed.svg#REDBOX hasn't been detected!

      Batik 1.7 renders the pair of SVGs correctly, as seen in correct.png. Viewer output is in incorrect.png.

      Stepping through the library gets me to createUseNode() in qsvghandler.cpp:3256. The first line of this function removes the first character of a xlink:href attribute, I guess assuming all links will be purely document-local and start with #.

      Following the documentation trail:
      http://qt.nokia.com/doc/4.6/paintsystem-images.html
      Supports the static features of SVG Tiny 1.2:
      http://www.w3.org/Graphics/SVG/feature/1.2/#SVG-static
      XlinkAttribute is a static feature:
      http://www.w3.org/Graphics/SVG/feature/1.2/#XlinkAttribute
      Points you to the Xlink Attribute Module:
      http://www.w3.org/TR/SVGMobile12/linking.html#xlink-att-mod
      Section 14.1.4: Reference restrictions:
      http://www.w3.org/TR/SVGMobile12/linking.html#ReferenceRestrictions
      Class B reference on a 'use' element is allowed, subject to some restrictions that don't come into play for the attached SVGs.

      Attachments

        1. correct.png
          correct.png
          16 kB
        2. incorrect.png
          incorrect.png
          8 kB
        3. svg_example.zip
          0.8 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            matthias_rauter Matthias Rauter
            genpfault Charles Huber
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes