[PyKDE] QImage to QPixmap conversion in a list comprehension

Phil Thompson phil at riverbankcomputing.co.uk
Fri Oct 28 18:21:26 BST 2005


On Friday 28 October 2005 3:15 pm, Alexander Borghgraef wrote:
> Hi all,
>
> I'm trying to convert a list of scipy arrays to a list of QPixmap objects.
> Scipy contains a function
> "toimage" which converts an array (matrix actually) to a QImage object so
> my naive implementation was
>
> import scipy
> from qt import *
>
> # imgList is a list of scipy arrays
> pixmapList = [ QPixmap(scip.toimage(img)) for img in imgList ]
>
>  Apparently, this doesn't work, there's no such constructor equivalent to
> the C++ version.

Yes there is. What do you mean by "doesn't work".

Phil




More information about the PyQt mailing list