问题
Using PySide2, it's possible to create signals in two ways that I know of:
file_changed = Signal()
or
@Signal
def file_changed(self):
pass
They both seem to do the same thing. What if I want a signal that can emit a value? I know I can do:
file_changed = Signal(str)
...
def load_file(self, file_name):
self.file_changed.emit(file_name)
But what is the equivalent using the @Signal decorator?
来源:https://stackoverflow.com/questions/57204514/what-are-the-differences-between-creating-signals-in-these-two-different-ways