From anonymous, 2 Years ago, written in Python.
This paste is a reply to Untitled from anonymous
- go back
Embed
Viewing differences between Untitled and Re: Untitled
from PyQt5.QtCore import QObject, pyqtSignal

pyqtSignal, pyqtSlot

class Signaller(QObject):

    signal = pyqtSignal(str)


pyqtSignal(str)

    @pyqtSlot(str)
    
def slot(arg1, arg2='bar'):
    
slot(self, arg1, arg2='bar'):
        
print(arg1, arg2)

sig = Signaller()
sig.signal.connect(slot)
connect(sig.slot)
sig.signal.emit('foo')  # prints foo barbar