How can I change the interval of a Qtimer inside of a Qthread?
问题 I want to be able to change the interval time of a QTimer inside of a QThread. This is my code. import sys from PyQt5 import QtWidgets from PyQt5.QtWidgets import QApplication, QMainWindow from PyQt5.QtCore import QObject, QTimer, QThread class Worker(QObject): def __init__(self): QObject.__init__(self) self.timer = QTimer(self) self.timer.timeout.connect(self.work) def start(self): self.timer.start(1000) def work(self): print("Hello World...") def set_interval(self, interval): self.timer