I\'m having problem with QThreads in python. I want to change background color of label. But My application crash while starting. \"QThread: Destroyed while thread is still
You're not storing a reference to the thread after it's been created, which means that it will be garbage collected (ie. destroyed) some time after the program leaves MainWindow
s __init__
. You need to store it at least as long as the thread is running, for example use self.statusTh
:
self.statusTh = statusThread(self)
self.connect(self.statusTh, SIGNAL('setStatus'), self.st, Qt.QueuedConnection)
self.statusTh.start()