Send and receive signals from another class pyqt

后端 未结 1 634
情歌与酒
情歌与酒 2021-01-28 07:52

I am needing a way to receive signals sent by a Class to another class. I have 2 classes: In my first class I have a function that emits a signal called \'asignal\' In my secon

1条回答
  •  礼貌的吻别
    2021-01-28 08:35

    QPushButton is not a Signals object, so thats why you get the error.

    s = Signals()
    s.asignal.connect(lambda sig: print("Signal recieved" + sig))
    s.do_something()
    

    0 讨论(0)
提交回复
热议问题