title: Scaling SVGs without affecting line-width and radius with Qt
body: <p>I'd like to use SVGs as scalable background images (e.g. a rounded rectangular as background of a button). My problem is, that the button size depends on the button content - e.g. its text. Now I need a method to paint my SVG in different sizes and aspects, but with the same line-width and radius.</p>
  
  <p>In my approach I used a SVG with 100% width and height</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;svg xmlns="http://www.w3.org/2000/svg"&gt;
  &lt;rect id="rect0815" x="0" y="0" width="100%" height="100%" rx="15" ry="15" 
        fill="red" stroke="#000000" stroke-width="2"/&gt;
  &lt;/svg&gt;
  </code></pre>
  
  <p>and rendered it as background:</p>
  
  <pre><code>void paintEvent(QPaintEvent * pEvent)
  {
      QPainter oPainter( this );
      QSvgRenderer oRenderer( QString("../share/images/background.svg") );
      oRenderer.render( &amp;oPainter, pEvent-&gt;rect() );
  }
  </code></pre>
  
  <p>But this gave me the same distorted result as using a fix-width SVG. Also I tried <code>QSvgRenderer::setViewPort()</code> without any positive effect.</p>
  
  <p>Best regards,</p>
  
  <p>Charly</p>