I\'m sorry for the question but I have read a bunch of things and it seems that I do not get how to make a timer. So I\'m posting my code:
from PyQt4 import
Use new style signals, they are easier to understand.
Swap -
QtCore.QTimer.connect(timer, QtCore.SIGNAL("timeout()"), self, QtCore.SLOT("func()"))
With -
timer.timeout.connect(self.move_towards) # assuming that move_towards is the handler
A simple but full example of a working timer -
import sys
from PyQt4.QtCore import QTimer
from PyQt4.QtGui import QApplication
app = QApplication(sys.argv)
app.setQuitOnLastWindowClosed(False)
def tick():
print 'tick'
timer = QTimer()
timer.timeout.connect(tick)
timer.start(1000)
# run event loop so python doesn't exit
app.exec_()