子类继承QThread后,如何添加参数?

我是这样添加的,但是实例化的时候报错,求解

class WorkThread(QThread):
    trigger = pyqtSignal(int)
    def __int__(self,name,path):
        # 初始化函数
        super(WorkThread,self).__init__()
        self.name = name
        self.path = path

    def run(self):

实例化

self.work = WorkThread(name,path)

报错信息

TypeError: QThread(parent: QObject = None): argument 1 has unexpected type 'str'

查看全部
weixin_44762713
粟悟饭&龟波功
2020/05/30 15:19
  • python
  • 点赞
  • 收藏
  • 回答
    私信

3个回复