使用以下代码,当尝试发出信号时,我会收到一个错误提示('PySide.QtCore.Signal' object has no attribute 'emit'
):
#!/usr/bin/env python
from PySide import QtCore
class TestSignalClass(QtCore.QObject):
somesignal = QtCore.Signal()
def speak_me(self):
self.speak.emit()
def __init__(self):
try:
self.somesignal.emit()
except Exception as e:
print("__init__:")
print(e)
t = TestSignalClass()
我该怎么做才能解决这个问题?