[PyKDE] QImage to QPixmap conversion in a list comprehension

Patrick K. O'Brien pobrien at orbtech.com
Fri Oct 28 18:30:04 BST 2005


Phil Thompson wrote:
> 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".

Could be as simple as a typo - is the code really:

  scip.toimage

and not:

  scipy.toimage

-- 
Patrick K. O'Brien
Orbtech       http://www.orbtech.com
Schevo        http://www.schevo.org




More information about the PyQt mailing list