Created a Qthread to handle a version check for my application. The Thread works perfectly, except that it is emitting the finished signal twice.
class myThread(QtCore.QThread):
def run(self):
print("Im running.")
self.finished.emit()
def stop(self):
self.terminate()
class myApp(QtWidgets.QMainWindow, Ui_App):
def __init__(self, parent=None):
super(myApp, self).__init__()
self.myThread = myThread()
self.myThread.start()
self.myThread.finished.connect(self.allDone)
def allDone(self):
print('Thread is done')
How do I prevent the signal from being emitted twice?