[PyQt] QProcess issues

Detlev Offenbach detlev at die-offenbachs.de
Sat Sep 13 14:54:37 BST 2008


On Samstag, 13. September 2008, Oguz Yarimtepe wrote:
> Here is the code i am working on. http://rafb.net/p/ZZvzwR89.html
>
> I know it is not a professional one but i am just learning and trying to
> figure out things to do the better ones.
>
> The problem is about the QProcess. There are 3 pages at the QWizard and
> when the user enters the Page3 the run() is executed. run() calls some
> functions that run some scripts at the background. At the end of each
> function i am updating the progress bar. To test the code i just enabled
> three functions. I was hoping to see that the gui will be updated at the
> end of the prepare.sh script end while it is being executed. But
> cleanTheFiles and reboot functions also traversed so the progress bar
> showed %100. So it seems i am missing something. Will be happy if
> someone help me.

You probably want to execute the processes sequentially, i.e. start the next 
when the previous one has finished. In order to do that you should use code 
like this in your startProcess method after self.process.start().

if ok:
  finished = self.process.waitForFinished()

Regards,
Detlev
-- 
Detlev Offenbach
detlev at die-offenbachs.de


More information about the PyQt mailing list