views:

101

answers:

1

I am using a QProgressDialog to show the status of a long running operation, which includes a step of running an external executable. I run the external executable using the QProcess::execute() method. QprogressDialog works fine updating the label text till it reaches the QProcess::execute() method, after which it doesn't update the state.

How to update the state after running the executable.

+2  A: 

QProcess::execute() is a blocking method: it will block its calling thread until the spawned process will terminate. It you call this method from the main thread, UI events will not be handled until the method will return.

To get around this you can create an instance of QProcess (rather than using its static methods) and then create a slot that continues the part of the operation that happens after the external process finishes running, and connect it to the QProcess::finished(int, QProcess::ExitStatus) signal.

IgKh