I use Qt for Python for a while now and find myself often asking: What is the usefulness of the Slot() decorator? If I connect to a signal the documentation says I should decorate my callable function with the Slot()
decorator. But is there any computational necessity or advantage in doing so? The following example connects two slots to the "pressed"-signal of a button. Both functions will work perfectly fine.
self.btn.pressed.connect(self.on_btn_pressed1)
self.btn.pressed.connect(self.on_btn_pressed2)
@Slot()
def on_btn_pressed1:
print("Hello")
def on_btn_pressed2:
print("World")