Re: QProcess wo event loop
Have you tried a connection to this signal:
QProcess::readyReadStandardOutput ()
Re: QProcess wo event loop
Thanks for your reply but I wish to avoid the asynchronous process calling due to the nature of my task. Finally I think I have found the solution, process.waitForReadyRead must be used:
Code:
process.start("something", args);
if (!process.waitForStarted()){
// some error message
return;
}
while (process.waitForReadyRead(-1)){
QByteArray newData
= process.
readAllStandardOutput();
result
= QString::fromLocal8Bit(newData
);
qDebug
(qPrintable
(QString("waitForReadyRead:")+result
));
}
// here the process is already finished
And I do not need the process.waitForFinished method at all.