Qt progress dialog and window focus

I’m pretty sure im missing somethign smple here, but on every one of my progress dialog calls, i need to call QEventLoop.processEvents() in order to get the ui to update properly and see if the user clicked cancel. However, by calling this, maya will constantly get window focus again so it makes using other apps while the progress bar is running difficult.Is there a trick to this? How do you guys do your progress dialog tasks?Thanks