Updating GUI elements in MultiThreaded PyQT

Here some very basic examples. You can pass references to GUI elements to threads, and update them in thread. import sys import urllib2 from PyQt4 import QtCore, QtGui class DownloadThread(QtCore.QThread): def __init__(self, url, list_widget): QtCore.QThread.__init__(self) self.url = url self.list_widget = list_widget def run(self): info = urllib2.urlopen(self.url).info() self.list_widget.addItem(‘%s\n%s’ % (self.url, info)) class MainWindow(QtGui.QWidget): def __init__(self): super(MainWindow, … Read more