<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>I'll try to clarify the new slot/signal style a bit, hopefully somebody else will fill in more.<br><br></div>To start, just forget the old style entirely. A signal is a property of an object. It happens to have a method connect(). Thus<br><br></div>    input_line = QLineEdit()<br></div>    input_line.editingFinished.connect( self.accept_input_line )<br><br></div>The argument to connect is an executable, typically self.some_method but often just a slot (i.e. method) on some other widget, as when you have an Edit menu with an Undo action, and you do<br><br></div>    undo_action = my_edit_menu.addAction( QAction('Undo') )<br></div>    undo_action.triggered.connect( my_plain_text_editor.undo )<br><br></div>(The "slot' executable can even be a lambda! Which is sometimes quite handy.)<br><br>You are trying to create a signal of your own. I don't think much of the python central tutorial you linked, it seems oriented to PySide and doesn't seem to match up with the PyQt5 doc, here:<br><br>    <a href="http://pyqt.sourceforge.net/Docs/PyQt5/signals_slots.html">http://pyqt.sourceforge.net/Docs/PyQt5/signals_slots.html</a><br><br></div>Follow the syntax under "Defining new signals with pyQtSignal". You are defining a class property, i.e. declared at the top level of a class definition, and what is not made explicit in that writeup, is that the class must derive from QObject (not python's object). Once you have defined the signal, e.g.<br><br></div>    class myWidget( QWidget ):<br></div>        databaseChanged = pyQtSignal()<br><br></div>it is a property of the class ergo of every object of the class. In the __init__ probably you would do something like,<br><br></div>    self.databaseChanged.connect( self.react_to_db )<br><br></div>Or possibly in some OTHER object's __init__ it creates a myWidget and connects it:<br><br></div>    new_widgy = myWidget(blah blah)<br></div>    new_widgy.databaseChanged.connect( self.catch_new_widgy )<br><br></div><div>When it is time to emit the signal, you just invoke its emit method,<br><br></div><div>    if database_has_changed :<br></div><div>        self.databaseChanged.emit()<br><br></div>It looks as if you are trying to have your signal not just exist but pass a parameter? The syntax for that in pyQtSignal is a bit obscure and I'm not comfortable with it so maybe somebody else can write about that.<br><br></div>