Re: Lost line with QProcess
Try put \n before first line :rolleyes:
Re: Lost line with QProcess
Try doing it the proper way -- connect the readyReadStandardOutput() signal from your process to a slot and read the data there, and don't read a single line, but rather all of them at once.
Code:
connect(process, SIGNAL(readyReadStandardOutput ()), this, SLOT(fetchOutput()));
connect(process,
SIGNAL(finished
( int,
QProcess::ExitStatus )),
this,
SLOT(fetchRest
()));
process->start("...");
//...
void thisClass::fetchOutput(){
while(proc->canReadLine()){
cout << proc->readLine().constData() << endl;
}
}
void thisClass::fetchRest(){
cout << proc->readAllStandardOutput().constData();
}