[PyQt] How to get Qt signals delivered to a pure python thread.

Florian Bruhin me at the-compiler.org
Thu Jan 8 09:27:47 GMT 2015


* Giuseppe Corbelli <giuseppe.corbelli at copanitalia.com> [2015-01-08 10:13:50 +0100]:
> On 08/01/2015 09:00, Ilya Kulakov wrote:
> >More Qt question rather than pyqt, but is it possible to control run time
> >of  an event loop? According to docs, there is just a blocking exec function and
> >it's not possible to run qeventloop for N seconds (as e.g. Cocoa's CFRunLoop).
> 
> Yes, but you can repeatedly call processEvents() in a while loop and
> constantly check the elapsed time.

processEvents has an overload with a maxTime argument, isn't that
exactly what Ilya is looking for?

    Process pending events that match flags for a maximum of maxTime
    milliseconds, or until there are no more events to process,
    whichever is shorter.

http://doc.qt.io/qt-5/qeventloop.html#processEvents-2

Florian

-- 
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150108/4a26d4fd/attachment.sig>


More information about the PyQt mailing list