1st part:
If the timed part of your code is rather computation heavy it would be good to do it in a QThread - if not there is no need to make things complicated.
As said by x3al in the comment, there is no obvious reason why you should not be able to do the timing using QTimer. If you need a repeating signal you can use setInterval. If its about a single signal after X ms you can just use singleShot (pyqt4-doc).
2nd part:
If I get this part correctly you are asking for advice on how to use threads - as this depends on your implementation (movetothread vs subclassing), have a look at this answers Background thread with QThread in PyQt
Allow me to recycle an example I used before on this matter:
class ThreadObject(QObject):
started = pyqtSignal()
finished = pyqtSignal()
def __init__(self, var1, var2):
super(ThreadObject, self).__init__()
self.var1 = var1
self.var2 = var2
self._isRunning = True
def stop(self):
_isRunning = False
def run(self):
# do something with the var's and send the results to where they are needed while _isRunning is True
class UIelement(QWidget):
# initialize, create UI and so on
def clicksomebutton(self):
self.obj = ThreadObject(self.var1, self.var2) # handle copies of vars to object
self.thread = = QThread(self, objectName='workerThread')
self.obj.moveToThread(self.thread)
# connect start, stop, run, etc.
self.thread.start()
Hope this helps you!