[PyQt] wx.MilliSleep equivalent

Tong Zhang warriorlance at gmail.com
Mon Oct 1 22:02:58 BST 2018


Hello Chris,

Thanks, I've tried like this:

from PyQt5.QtCore import QCoreApplication
from PyQt5.QtCore import QEventLoop

QCoreApplication.processEvents(QEventLoop.WaitForMoreEvents, msec)

but had no luck, it does not behavior the same as qWait(msec). Did I use 
this method correctly?

Tong

On 09/22/2018 02:02 AM, Chris Pezley wrote:
> Hi Tong,
> 
> maybe what you want is "QtWidgets.qApp.processEvents()"? (make sure to 
> look at the one with the optional argument for maxtime)
> http://doc.qt.io/qt-5/qcoreapplication.html#processEvents-1
> 
> On 21/09/2018 20.22, Tong Zhang wrote:
>> Hello,
>>
>> When I'm building applications by wxPython, there is a function 
>> wx.MilliSleep could be used to do non-GUI-block sleep, while I cannot 
>> find the similar thing in PyQt, is it available or not? Otherwise, 
>> what I can do to is to use QThread. Any comment is appreciated!
>>
>> Tong
>>
>>
>> _______________________________________________
>> PyQt mailing listPyQt at riverbankcomputing.com
>> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
> 
> 
> 
> 
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
> 


More information about the PyQt mailing list