q等待 PySide 中的类似物?

tay*_*ron 5 pyqt pyside qtestlib

我使用 QTest 和 unittest 在 PyQt 中编写了一系列单元测试。我的代码传递信号,因此为了确保在测试之前操作后经过了足够的时间,我添加了一些 qWaits。

APP.ui.serverPortEdit.setText('1234')
QTest.mouseClick(APP.ui.userConnectButton, Qt.LeftButton)
QTest.qWait(2000) #wait for the server to connect
self.checkOnline()
Run Code Online (Sandbox Code Playgroud)

我想在 PySide 中运行相同的测试,但我找不到 qWait 的类似物。我是不是忽略了什么?PySide qTest 文档没有提及它。

Ale*_*Vhr 2

你不能使用python的time.sleep()吗?