To answer the question of how to emit a signal in python:
Unlike C ++, when issuing a custom PyQt signal (unlike Qt one), the signature must be omitted.
So, to emit a signal, do something like this:
thread.emit(QtCore.SIGNAL('newArtworkAvailable'), icon)
And to connect to the signal, do something like this:
widget.connect(thread, QtCore.SIGNAL('newArtworkAvailable'), widget.setNewArtwork)
And just to be clear:
For this to work, the non-gui stream must emit a signal, which then receives the corresponding widget in the main gui stream. Creating a QImage in a non-gui thread should be fine, but never try to call any gui-related methods outside the main thread.
NB
I used the old-style signal syntax because this is what you seem to be using. However, you can look at PyQt's new style and slot support , as it is much more flexible and pythonic.
source share