PyQt4 - timer.timeout.connect() - cannot find reference
问题 from PyQt4 import QtGui, QtCore from code.pair import Pair from code.breadth_first_search import breadth_first_search import functools class Ghosts(QtGui.QGraphicsPixmapItem): def __init__(self, name): super(Ghosts, self).__init__() self.set_image(name) def chase(self, goal): pos = Pair(self.x(), self.y()) path = breadth_first_search(pos, goal) func = functools.partial(self.move_towards, path) timer = QtCore.QTimer() timer.timeout.connect(func) timer.start(700) def move_towards(self, path):