QtCore.Qt.DirectConnection
-- this option means that the slot will be called from the signal's thread. Your code has (at least) two threads running: the main GUI thread and the DownloadThread
. So, with this option, the program tries to invoke threadDone
from DownloadThread
, and tries to create a GUI object outside the GUI thread.
This leads to: QPixmap: It is not safe to use pixmaps outside the GUI thread
Remove this option and the default behavior (wait to return to main thread before invoking the slot) should clear up the error.