Re: [PyQt] issue with QPainter.drawPolyline and list of QPoints
On Wednesday 01 February 2012, 09:57:35 Phil Thompson wrote: > On Wed, 1 Feb 2012 01:25:57 +0100, "Hans-Peter Jansen" > > > wrote: > > Hi Phil, > > > > shouldn't this work: > > > > from PyQt4 import QtCore, QtGui > > app = QtGui.QApplication([]) > > pixmap = QtGui.QPixmap(16, 16) > > painter = QtGui.QPainter(pixmap) > > plist = [QtCore.QPoint(0, 15), QtCore.QPoint(0, 0), > > QtCore.QPoint(15, > > 0)] > > > painter.drawPolyline(plist) > > No, try... > > painter.drawPolyline(*plist) Of course, silly me. Thanks, Phil. Pete ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] issue with QPainter.drawPolyline and list of QPoints
On Wed, 1 Feb 2012 01:25:57 +0100, "Hans-Peter Jansen" wrote: > Hi Phil, > > shouldn't this work: > > from PyQt4 import QtCore, QtGui > app = QtGui.QApplication([]) > pixmap = QtGui.QPixmap(16, 16) > painter = QtGui.QPainter(pixmap) > plist = [QtCore.QPoint(0, 15), QtCore.QPoint(0, 0), QtCore.QPoint(15, 0)] > painter.drawPolyline(plist) No, try... painter.drawPolyline(*plist) Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] issue with QPainter.drawPolyline and list of QPoints
Hi Phil, shouldn't this work: from PyQt4 import QtCore, QtGui app = QtGui.QApplication([]) pixmap = QtGui.QPixmap(16, 16) painter = QtGui.QPainter(pixmap) plist = [QtCore.QPoint(0, 15), QtCore.QPoint(0, 0), QtCore.QPoint(15, 0)] painter.drawPolyline(plist) With PyQt 4.9, this results in: TypeError: arguments did not match any overloaded call: QPainter.drawPolyline(QPointF, ...): argument 1 has unexpected type 'list' QPainter.drawPolyline(QPolygonF): argument 1 has unexpected type 'list' QPainter.drawPolyline(QPoint, ...): argument 1 has unexpected type 'list' QPainter.drawPolyline(QPolygon): argument 1 has unexpected type 'list' QPaintDevice: Cannot destroy paint device that is being painted Speicherzugriffsfehler although you provide a %MethodCode handler for the list of QPoints case. Ref: line 354 in sip/QtGui/qpainter.sip Hmm, Pete ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt