[PySide] sending data from urllib2.urlopen().read() via signal corrupts in receiver

Frank Rueter | OHUfx frank at ohufx.com
Sun Oct 22 10:18:41 CEST 2017


Hi,

I am downloading a few images in a separate thread using QRunnable.
To download I am just using urllib2.urlopen() like this:

[...]
     def run(self):
         imageData = urllib2.urlopen(self.url).read()
         print 'emitted:', imageData
         self.signals.receivedData.emit(imageData) # this signal is 
declared like this: QtCore.Signal(str)


However, the receiving slot is receiving nothing:

     def setPixmap(self, imageData):
         print 'received:', imageData
         pixmap = QtGui.QPixmap()
         pixmap.loadFromData(imageData)
         self.data['pixmap'] = pixmap


I guess this is too naive an approach to download image data in a 
separate thread?!

How can I fix this please?

Cheers,
frank


-- 
ohufxLogo 50x50 <http://www.ohufx.com> 	*vfx compositing 
<http://ohufx.com/index.php/vfx-compositing> | *workflow customisation 
and consulting <http://ohufx.com/index.php/vfx-customising>* *

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20171022/711d64b0/attachment.html>


More information about the PySide mailing list