[PyQt] issue with QPainter.drawPolyline and list of QPoints
Hans-Peter Jansen
hpj at urpla.net
Wed Feb 1 22:58:20 GMT 2012
On Wednesday 01 February 2012, 09:57:35 Phil Thompson wrote:
> 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)
Of course, silly me.
Thanks, Phil.
Pete
More information about the PyQt
mailing list