PyQt 自定义信号带参数 emit
作者:互联网
PyQt5 自定义信号带参数
import sys from PyQt5.QtCore import pyqtSignal, QObject from PyQt5.QtWidgets import QMainWindow, QApplication class mysignal(QObject): closeApp = pyqtSignal(list) class Example(QMainWindow): def __init__(self): super().__init__() self.c = mysignal() self.c.closeApp.connect(self.myclose) self.show() def mousePressEvent(self, event): hehe = list(range(10)) self.c.closeApp.emit(hehe) def myclose(self, mylist): print(mylist) self.close() if __name__ == '__main__': app = QApplication(sys.argv) ex = Example() sys.exit(app.exec_())
REF
https://www.cnblogs.com/codeAB/p/5029133.html
标签:__,自定义,self,PyQt5,sys,PyQt,import,emit,closeApp 来源: https://www.cnblogs.com/emanlee/p/15811122.html