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"> def __init__(self, parent=None):<br> QtGui.QWidget.__init__(self, parent)<br>
<br> self.setGeometry(300, 300, 250, 150)<br> self.setWindowTitle('Draw Text')<br><br> self.picture = QtGui.QPicture()<br> self.picture.load("images/grid.svg")<br> <br>
<br> def paintEvent(self, event):<br> paint = QtGui.QPainter()<br> paint.begin(self)<br> paint.drawImage(0,0,self.picture)<br> 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'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>