pyqtSignal
is not a signal, it is a factory function for creating signals, so of course it doesn't have a emit
attribute. It just returns a descriptor, which when bound to a QObject instance will return the actual signal object. That means only a bound signal will have an emit
method.
The QObject.emit
method is a relic from times before new style signals were introduced in pyqt, and now has been removed. Just use the emit
method on the bound signal to emit it:
class SomeObject(QObject):
someSignal = pyqtSignal(...)
instance = SomeObject()
instance.someSignal.emit(value)