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>Niels<br><br>