From anonymous, 2 Years ago, written in Python.
Embed
  1. from PyQt5.QtCore import QObject, pyqtSignal
  2.  
  3. class Signaller(QObject):
  4.  
  5.     signal = pyqtSignal(str)
  6.  
  7.  
  8. def slot(arg1, arg2='bar'):
  9.     print(arg1, arg2)
  10.  
  11. sig = Signaller()
  12. sig.signal.connect(slot)
  13. sig.signal.emit('foo')  # prints foo bar

Replies to Untitled rss

Title Name Language When
Re: Untitled anonymous python 2 Years ago.