[PyQt] Unexpected behaviour

Peter Milliken peter.milliken at gmail.com
Tue Aug 17 04:07:00 BST 2010


Sorry if the answer to this is obvious, but it is entirely unexpected
behaviour IMO :-)

I have created a simple GUI with some elements, such as a progressbar and
radiobuttons, which are 'dynamically' updated when an underlying Python task
(created using threading.Thread) communicates information back to the GUI
i.e. I have a button, which calls a command, which starts a task and then
loops continuously receiving update commands from the task via a pipe and
updating the GUI elements with the information (radio buttons indicate which
phase of the process is being executed, the progress bar indicates %
completion for each phase).

This all works fine, but the unexpected behaviour is when I switch focus
away from the GUI application all of the graphics elements stop being
updated! The underlying task is running and it runs to successful completion
but no further graphics updates are performed once I switch focus away from
the application. Even if I switch back to the application, the GUI elements
remain "frozen" at the point at which I switched away until the task
completes - it is only then that the graphics elements are changed due to
the message from the task that the operation is complete i.e. the "phase"
radio buttons are returned to a default value and the progress bar is
cleared to 0%..

Why is this happening? If I ran a similar application with Tkinter then it
wouldn't happen. What is it in PyQt that I am missing?

Hope this makes sense :-)

Thanks
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100817/a5f37759/attachment.html>


More information about the PyQt mailing list