[PyQt] GUI freezing when running large function in QThread

Brent Villalobos Brent.Villalobos at pdi.dreamworks.com
Tue Jul 21 00:35:56 BST 2009


I'm trying to write a "validation" thread that will run persistently 
throughout my PyQt program and validate that user has entered the 
correct values in the fields.  The validation thread calls a function in 
a separate python module that shouldn't know anything about PyQt since 
it is a general-purpose module that runs in both gui and non-gui 
applications.  The problem is that my GUI slows way down where actions 
like mouse clicks aren't recognized until the validation function 
finishes.  The validation function is doing some mild CPU and I/O work, 
but nothing that peaks out the processor or disk.  Unfortunately I don't 
have a simple case to show at this time, but perhaps people have run 
into a similar issue in past.  Anyone have any suggestions how I can 
make a function that runs in a QThread more "gui-friendly" without 
adding any Qt-specific calls to it?  Thanks.


More information about the PyQt mailing list