I'm not entirely sure I understand what you're doing, but a couple of observations:
- QProcess:waitForFinished() will block for 30,000 milliseconds (30 seconds). If your process ends before 30 seconds is up, it will return. It will also return after 30 seconds expires even if your QProcess is still running. Just used the QProcess signals to get state changes and/or finished notification, etc.
- Not sure what your while loop is trying to accomplish. You will get the process exit code and exit status in the finished signal. Use that to determine whether your process ran successfully.
- Your progress bar updates are likely not reflecting the completion status since you are arbitrarily updating your progress every .5 seconds. How many seconds will the process run to completion, does it vary?
- You can read output of your QProcess, so if it's outputing any information while running, you can consume that output to get a better completion status if your process normally displays this. I have used QProcess like this in the past where i read the stdout and stderr of the QProcess to determine progress, etc.
Good luck.




Reply With Quote
Bookmarks