[PyQt] issue with QPainter.drawPolyline and list of QPoints

Phil Thompson phil at riverbankcomputing.com
Wed Feb 1 08:57:35 GMT 2012


On Wed, 1 Feb 2012 01:25:57 +0100, "Hans-Peter Jansen" <hpj at urpla.net>
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


More information about the PyQt mailing list