[PyQt] Run a job in background

2010-03-24 Thread dalvarez


Hello everybody, 

I'm starting with the PyQt programming so my knowledge on this is not very
broad at the moment, then I'm asking for some help if possible :) Well,
here my problem: 

I'm programming a GUI to collect some variables for afterwards running a
long and time consuming process (like 2h maybe). The main window is done
and the job is ready to be launched. I have a button connected to a
function that calls an external program with the variables gathered. 

What I'd like to do is: when I click this button, it opens a new small
window that can control the process (stoping it if necessary, tracking the
process with a progress bar and receive piped errors). 

But what I actually have is that when I click this button it launhes the
process blocking the main window losing all control. I have to kill the job
and the window if I want to stop it. 

So, my questions would be: 

- How can I open that small window to receive and track the process? 

- How to connect the function (at
the moment outside the main class) to
the progress bar and to that small window? 

- How to launch the external program in background mode without blocking
all the windows? 

I'd really appreciate some help on this! I'm quite lost and the
documentation is really confusing... 

Thank you very much in advance! 

Daniel 

 ___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Run a job in background

2010-03-24 Thread Russell Valentine
On 03/24/10 08:18, dalvarez wrote:
 So, my questions would be: 
 
 - How can I open that small window to receive and track the process? 
 
 - How to connect the function (at
 the moment outside the main class) to
 the progress bar and to that small window? 
 
 - How to launch the external program in background mode without blocking
 all the windows? 


I'd make run a thread (QThread) and send the output of the process to
the small window and progress bar using signals and slots.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt