[Qt-interest] Problem with QProcess and output

R. Reucher rene.reucher at batcom-it.net
Tue Nov 3 20:38:30 CET 2009


On Tue, 03 Nov 2009 20:17:30 +0100, mierdatutis mi wrote:
> I have a QProcess and a signal with readyReadStandardOutput. I have
> associated this QProcess with a QProgressBar. When the script gives me
> an output, for instance,if the script gives me a number 1, the progress
> bar goes to 33 %.
> 
> The problem is that if I execute the python script it gives me ok the
> standard output, because the standard output is progressive, but with
> QProcess and the signal readyReadStandardOutput get the standard output
> when the script finalished instead do it progressive.
That sounds like the virtual terminal buffers the I/O... I've seen that 
already in other situations. Try running the Python script with "python -
u ...", because according to "man python" that should disable any 
buffering:

-u     Force stdin, stdout and stderr to be totally unbuffered. [...]

HTH, René
-- 
René Reucher
rene.reucher at batcom-it.net
http://www.batcom-it.net/



More information about the Qt-interest-old mailing list