################################ # PyQt5中文網(wǎng) - PyQt5全套視頻教程 # # https://www.PyQt5.cn/ # # 主講: 村長 # ################################ from PyQt5.Qt import * class MySignal1(QObject): sendmsg = pyqtSignal([str], [str, int]) def send_msg(self): self.sendmsg[str, int].emit('hello', 2) self.sendmsg[str].emit('hello') class Myslot1(QObject): def get_msg(self, str, a): print('你好' + str) print(a) mysignal1 = MySignal1() myslot1 = Myslot1() mysignal1.sendmsg[str, int].connect(myslot1.get_msg) # mysignal1.sendmsg[str].connect(myslot1.get_msg) mysignal1.send_msg()
?
本文摘自 :https://www.cnblogs.com/