|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
signUpdate = pyqtSignal(list) #在tcpServer.py的Thread()类中自定义信号signUpdate,发射时传输参数list
#(signUpdate是定义在类里的,不是__init__()里)
self.signUpdate.connect(listView.listView.slotSetListMap) #。。。。。1
self.signUpdate.emit(list(self.deviceDictionary.values())) #。。。。。2
self是tcpServer.py中Thread()类,槽slotSetListMap是listView.py中listView类里的一个方法:
def slotSetListMap(self, Qlist):
slm = QStringListModel()
slm.setStringList(Qlist)
self.listView.setModel(slm)
运行tcpServer.py文件,执行 2 时,报错
Exception "unhandled TypeError"
slotSetListMap() missing 1 required positional argument: 'Qlist'
为什么会缺少参数,信号不是已经发送参数了?是不能跨文件连接信号和槽,还是格式不对?
求大神解惑,感激不尽!!!! |
|