我用的是这样的东西:
import threading
from PySide import QtCore
class Smt(threading.Thread):
foo_signal = QtCore.Signal(object)
def __init__(self):
threading.Thread.__init__(self)
def run(self);
while True:
pass # and so..
然后我开始:
^{pr2}$输出为:
AttributeError: 'PySide.QtCore.Signal' object has no attribute 'connect'
如果我使用QtCore.QThread
而不是threading.Thread
-它工作得很好。但我不想用QThread
。在
有可能吗?在
信号要求使用它们的类从QObject(或任何同时继承QObject的类)继承。因此,您可以切换到使用QThread,也可以从QObject继承并在
__init__
中调用QtCore.QObject.__init__(self)
相关问题 更多 >
编程相关推荐