Now I have found this:<br><br>self.picture = QtGui.QPicture()<br>self.picture.load(&quot;/home/user/grid.jpg&quot;)<br><br>And it gives the error:<br><br>QPicturePaintEngine::checkFormat: Incorrect header<br><br>I have tried with a jpg, bmp, svg and an png but all of them return an &quot;incorrect header&quot;. What am I doing wrong?<br>
<br>Niels<br><br><div class="gmail_quote">On Wed, Apr 16, 2008 at 9:43 PM, Niels Egberts &lt;<a href="mailto:niels.egberts@gmail.com">niels.egberts@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi, I am pretty new to qt4 and python (have have very limited experience with C++ and qt3).<br><br>I have a QWidget that I am using as a gameboard. So I want to draw svg images on it (like chesspieces and such). I have got this now:<br>

<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">&nbsp;&nbsp;&nbsp; def __init__(self, parent=None):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; QtGui.QWidget.__init__(self, parent)<br>

<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.setGeometry(300, 300, 250, 150)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.setWindowTitle(&#39;Draw Text&#39;)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.picture = QtGui.QPicture()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.picture.load(&quot;images/grid.svg&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>

<br>&nbsp;&nbsp;&nbsp; def paintEvent(self, event):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; paint = QtGui.QPainter()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; paint.begin(self)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; paint.drawImage(0,0,self.picture)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; paint.end()<br></blockquote><br>I understand that I need to place my image in a buffer and then do drawImage(0,0,self.buffer) but I can&#39;t find out how to do that. Can someone give me a code snippit on how I can achieve to render his svg?<br>

<br>Thank you very much,<br><font color="#888888">Niels<br><br>
</font></blockquote></div><br>