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_())

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-20
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-02
  • 2022-12-23
  • 2021-04-30
  • 2022-01-12
  • 2021-10-06
  • 2021-07-25
  • 2021-08-05
相关资源
相似解决方案