【发布时间】:2014-04-29 07:28:51
【问题描述】:
我正在尝试在 MacOS X 上使用 Anaconda python 运行我找到的这个简单示例 here。
import pyqtgraph as pg
import time
plt = pg.plot()
def update(data):
plt.plot(data, clear=True)
class Thread(pg.QtCore.QThread):
newData = pg.QtCore.Signal(object)
def run(self):
while True:
data = pg.np.random.normal(size=100)
# do NOT plot data from here!
self.newData.emit(data)
time.sleep(0.05)
thread = Thread()
thread.newData.connect(update)
thread.start()
但我不断得到:
QThread: Destroyed while thread is still running
【问题讨论】:
标签: python qt qthread pyqtgraph