[Qt-interest] Does QProcess::readAllStandardOutput have a limit?

Eric Clark eclark at ara.com
Thu Dec 2 19:31:28 CET 2010


Hello All,

I have an application that is built upon Qt 4.7.1. My application is spawning other instances of itself via QProcess. I would like to take the standard output from the processes that are started with QProcess and output them to the console window within the parent process. I have tried many different approaches, all with the same result. I have connected to both the readyRead and the readyReadStandardOutput signals to respond to the standard output of the spawned process. When the slot is entered that responds to the readyRead signal, I have tried calling both readAll and readAllStandardOutput and outputting the text to my console. Every time I do this, there is some text that is being cutoff in the readAll functions. No matter what signal I use or what readAll function I use, I always get the same result with some of the text being cut off. I also set the standard output file via  setStandardOutputFile and I get the same result, the text is cutoff at the same place. I have attached two text files: Process1.txt and output.txt. Process1.txt is the result of setting the standard output file and then starting the external process. Output.txt is the result of starting the application at the command line and redirecting the output using Windows redirect like so:

Myapplication.exe > output.txt

As you can see from the two files, the output.txt file contains all of the standard output text that my application outputs, and the Process1.txt file contains the start of the output, but is cutoff in the middle of the output.

I was wondering if anyone knew of some sort of limitation on the number of bytes that readAll, readAllStandardOutput, or setStandardOutputFile will read from the process? In all cases, the text is cutoff at the same point in the output. I do not see anywhere in the documentation for QProcess where it says there is a limit, but the results I am getting leads me to believe that there is a limit.

Thank You in Advance!
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101202/59350a71/attachment.html 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: output.txt
Url: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101202/59350a71/attachment.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Process 1.txt
Url: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101202/59350a71/attachment-0001.txt 


More information about the Qt-interest-old mailing list