[PyQt] Profiling with QThreads
Eric Frederich
eric.frederich at gmail.com
Tue Oct 4 15:03:00 BST 2011
Hello,
I have a client application that does a long running data traversal
making a lot of server calls.
I put this operation in a QThread so that the GUI would stay responsive.
I am now using a profiler on this application trying to see which
calls to the server are taking most of the time.
The problem here is that because its on a different thread the
profiler doesn't pick up any of the calls.
To get around this, on the QThread subclass I defined a method
start_single like so...
def start_single(self):
self.emit(SIGNAL('started()'))
self.run()
self.emit(SIGNAL('finished()'))
self.emit(SIGNAL('terminated()'))
So when I replace the call to start with a call to start_single, I get
the stuff I want in the profile.
Is there a better way to accomplish the same thing?
Am I missing something?
More information about the PyQt
mailing list