Thread继承了QThread和一个自定义类后,pyqtSignal发送信号出问题,这里的__init__该如何定义呢?
# 创建任务运行子线程
class Thread(QThread, CrazyChiefTask):
sin_status = pyqtSignal(str)
def __init__(self, dx, dy, statusList):
CrazyChiefTask.__init__(self, dx, dy)
# super(Thread, self).__init__()
self.statusList = statusList
self.dx = dx
self.dy = dy
try:
self.sin_status.emit('123')
except Exception as e:
print(e)
super-class init() of type Thread was never called
Process finished with exit code -1073740791 (0xC0000409)
加个这个试试
super(class名称, self).__init__()