[PyQt] Any way to run code before each QThread?

Ned Batchelder ned at nedbatchelder.com
Sun Jul 15 12:30:55 BST 2018


Hi,

I maintain coverage.py.  I have an issue 
(https://github.com/nedbat/coveragepy/issues/582) that the code running 
in QThreads aren't measured.  For the stdlib threading module, I have 
code that runs as each thread is created to start the measurement.  Is 
there any way to do the same for QThreads?

The stdlib feature is threading.settrace 
(https://docs.python.org/3/library/threading.html#threading.settrace). I 
didn't see anything similar for QThreads, or any other hook that would 
give me control before the thread starts running.  Am I overlooking 
something?

Does anyone have any other idea about how I could get this working?

Thanks,

--Ned.



More information about the PyQt mailing list