[Qt-interest] how to capture the QProcess output?

Andreas Pakulat apaku at gmx.de
Tue Sep 27 13:40:04 CEST 2011


On 27.09.11 16:53:25, Muthulingam Ammaiappan wrote:
> Hi Friends,
> 
> i wanted to capture the QProcess output and show....
> 
> here is the code snippet ....
> 
> *QString svnprogram = "./bin/svn.exe";*
> 
> *    QProcess *proc1 = new QProcess( this );*
> 
> *    proc1->setWorkingDirectory(workingdirpath);*
> 
> *    proc1->startDetached(svnprogram,arguments,workingdirpath);*

You need to re-read the API docs, startDetached is not a member
function, its a static function, so the above line is equivalent to

QProcess::startDetached(....)

and hence there's no state or output in your proc1 variable for the
detached process. Use the start() method if you want to start the
process as a subprocess of your application and read its output.

Andreas




More information about the Qt-interest-old mailing list