QProcess has signals that indicate when new data is ready to read from your 
process, allowing to to get line updates. Also, in your example, you are going 
to be blocking the event loop with your for loop.

I put together an example of each of those for you here:
https://gist.github.com/justinfx/5174795

The first example shows how to monitor the QProcess for new output

The second shows how to use subprocess in a way that you can loop over the 
output, but still pump the event loop. If your lines are being emitted quickly 
you probably don't need to make the call for every loop, but rather you could 
call on on every 10 lines...or 100 lines.. or whatever is appropriate to give 
your main gui thread a chance to process the pending events:

i.e.

i = 0
while True:
    line = process.stdout.readline()
    if not line:
        break

    # process line

    # process event loop every 10 lines
    if i % 10 == 0:
        QtGui.qApp.processEvents()
    i +=1 


-- justin



On Thursday, March 7, 2013 5:22:19 AM UTC+13, olheiros wrote:
> Hi Fellas!
> 
> 
> 
> i'm trying to build my own video converter gui on a Linux. Using Pyqt4.
> 
> I'm using avconv command line converter.
> 
> 
> 
> I have setup all parameters and it is working fine.
> 
> 
> 
> The thing is i would like to have some kind of progress feedback.
> 
> Does anyone know how to retrieve the command line feedback so
> 
> i can hook it to some kind of expression to drive the QProgressBar?
> 
> 
> 
> thank you very much
> 
> 
> 
> -- 
> 
> ////////////////////////////////////
> 
> Ricardo Viana
> 
> VFX Generalist

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to