QProcess with a program that call an other ... find stderror
Hi evivary,
I'm using Qprocess to call a program and this is working but this one calls an other program and that stderror of the second program doesn't appear in the QProcess::readAllStandardError()
Is there a way to do this. To obtain the data in stderror for the other program that is called in the QProcess ?
Hope u understand the problem.
Thanks
ILR
Re: QProcess with a program that call an other ... find stderror
you need the first process to forward the standard out/err from the second
Re: QProcess with a program that call an other ... find stderror
Quote:
Originally Posted by
amleto
you need the first process to forward the standard out/err from the second
The first process call the second so i can´t start one and when this finish stsrat the other.
process->start( "Compiler", args );
but the compiler use preprocesor.exe and this aparently doesn't execute
For example:
When i use the cmd prompt i have this result
>Compiler arch1
> output 1: message
> output 2: message
...
> found errors on arch1
and when i use QProcess the stderror jus give me the last message
>found errors on arch 1
the messages output 1: message are generated by the preprocessor.exe
Re: QProcess with a program that call an other ... find stderror
Each process has its own set of standard output channels. They are not inherited within the process group. Thus, as already said, your intermediate process would need to catch and forward output of the final process.
Re: QProcess with a program that call an other ... find stderror
Quote:
Originally Posted by
wysota
Each process has its own set of standard output channels. They are not inherited within the process group. Thus, as already said, your intermediate process would need to catch and forward output of the final process.
Thnks by the reply and Ok, so the question is how could catch the std output, this is the code that i use:
I have a class MCompiler : public QProcess
Code:
MCompiler::MCompiler( )
{
mCompiler = tr( "MCompiler" );
QProcessEnvironment pEnv = QProcessEnvironment::systemEnvironment();
pEnv.insert( "TMPDIR", SSPATH );
setProcessEnvironment( pEnv );
connect( this, SIGNAL( readyReadStandardOutput( ) ), this, SLOT( compileResult( ) ) );
}
here is the code when start my compiler
Code:
void MCompiler
::compile( QString fileFullPath
) {
argv << fileFullPath;
start( mCompiler, argv );
waitForFinished();
}
and i have the signal connected to the slot for read the stdOutput
Code:
void SGWMLSCompiler::compileResult()
{
qDebug() << line;
}
}
And here is where i just get the last std output for Compiler.
Re: QProcess with a program that call an other ... find stderror
Please understand, there is nothing you can do while calling the "compiler". It is the compiler process that has to catch output of its child process. By the way, you are monitoring standard output but reading standard error. Are you sure you are suppposed to do that?
Re: QProcess with a program that call an other ... find stderror
Thanks wysota. And for your second comment copy-paste error ... but i´m reading the standard output