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. QGraphicsSvgitem don't display svg with pattern
Forum Updated to NodeBB v4.3 + New Features

QGraphicsSvgitem don't display svg with pattern

Scheduled Pinned Locked Moved General and Desktop
qsvgrendererqgraphicssvgiteqt 5.4.1
3 Posts 2 Posters 2.3k 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.
  • D Offline
    D Offline
    David Schulz
    wrote on 29 May 2015, 09:01 last edited by David Schulz
    #1

    Hello,

    i have a problem with an svg File which includes a pattern.
    The QGraphicsSvgItem works very nice without pattern but if i use a svg file with pattern it will not be shown. Why?

    The svg File:
    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <svg width="100" height="100" viewBox="0 0 100 100"
    xmlns="http://www.w3.org/2000/svg" version="1.1">
    <desc>Example rect01 - rectangle with sharp corners</desc>

    <defs>
    <pattern id="pattern1" x="0" y="0" width="5" height="5" patternUnits="userSpaceOnUse" >
    <line x1="0" y1="0" x2="5" y2="5" style="stroke:rgb(0,0,0);stroke-width:0.5" />
    <line x1="0" y1="5" x2="5" y2="0" style="stroke:rgb(0,0,0);stroke-width:0.5" />
    </pattern>
    </defs>
    <rect x="0" y="0" width="100" height="100" style="fill: url(#pattern1)" />
    </svg>

    1 Reply Last reply
    1
    • D Offline
      D Offline
      David Schulz
      wrote on 29 May 2015, 09:57 last edited by
      #2

      Ok,
      i found that Qt implements the static elements of SVG Tiny 1.2.
      I found this from the year 2006. Has that changed ?

      Is there a other way to tile(fill) the given rect?
      Or I must fill it myself?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 29 May 2015, 22:11 last edited by
        #3

        Hi and welcome to devnet,

        The latest state of SVG support is described here AFAIK if you need a full blown SVG renderer then you'd need e.g. QtWebKit

        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

        3/3

        29 May 2015, 22:11

        • Login

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