I am trying to create a custom signal for a QRunnable Object for my PySide2 application. All examples have led me create a signal the following way:
class Foo1(QtCore.QObject):
def __init__():
super().__init__()
self.thread = Foo2()
self.thread.signal.connect(foo)
def foo():
# do something
class Foo2(QtCore.QRunnable):
signal = QtCore.Signal()
However, I am getting the following error on self.thread.signal.connect(foo)
:
'PySide.QtCore.Signal' object has no attribute 'connect'
How should I implement a custom signal for a QRunnable object?