我正在做计时极其重要的工作,并且对processEvents()的行为有一个问题。当我调用processEvents()时,它是否在单独的线程/进程上运行,以便在执行更多代码时仍在运行?
如果没有,我的代码是否有可能在processEvents()之后,但在我的监视器上的所有像素被更新到最新的场景之前继续执行(可能是因为操作系统处理像素绘制)?下面的伪代码
app = QtWidgets.QApplication(sys.argv)
window = MainWindow()
window.drawScene()
app.processEvents() #Force window to update to scene
print("Hi!") #Is there any chance of this being called before my screen's pixels are all set to the newest scene?如果processEvents()之后的代码确实在屏幕的像素全部更新之前运行,有没有一种方法可以保证在继续之前更新屏幕?
https://stackoverflow.com/questions/44396099
复制相似问题