PDA

View Full Version : Help on QProcess - Output Read



augusbas
23rd September 2009, 13:14
Hi,

I am running the below process in my application



QProcess *myProcess = new QProcess(this);
myProcess->start("/EXEC/Unlock");
myProcess->waitForFinished();
//qDebug() << "Unlock Output:" << myProcess->readAll();
qDebug() << "Unlock Output:\n" << myProcess->readAllStandardOutput();
QByteArray newData=myProcess->readAllStandardOutput();
qDebug() << "Unlock Output:" << newData;


But the output i read from the read using all the above methods gives empty string.

Help me


In my Process application I will put the below output in console:



qDebug() << "FileName Output:" << fileName;

augusbas
24th September 2009, 05:16
Hi,

I am running the below process in my application



QProcess *myProcess = new QProcess(this);
myProcess->start("/EXEC/Unlock");
myProcess->waitForFinished();
//qDebug() << "Unlock Output:" << myProcess->readAll();
qDebug() << "Unlock Output:\n" << myProcess->readAllStandardOutput();
QByteArray newData=myProcess->readAllStandardOutput();
qDebug() << "Unlock Output:" << newData;


But the output i read from using all the above methods gives empty string.

Help me


In my Process application I will put the below output in console:



qDebug() << "FileName Output:" << fileName;



Anybody please help

wirasto
24th September 2009, 05:46
I think you can read this thread

http://www.qtcentre.org/forum/f-qt-programming-2/t-check-ipaddress-existence-23723.html/?highlight=QProcess

He read ping output...

augusbas
24th September 2009, 06:19
I think you can read this thread

http://www.qtcentre.org/forum/f-qt-programming-2/t-check-ipaddress-existence-23723.html/?highlight=QProcess

He read ping output...

Hi,

thanks for reply...

In my process application, i am trying to put data through qdebug i.e I am printing a QString.

Whether this is the right way to put standard output data?

And i am reading the data in my application through readAllStandardOutput() ; But my output is empty string.

I referred the link send by you, still for me the same output "Empty String"

need your help

faldzip
24th September 2009, 07:45
qDebug() puts output on standard error so if you want to read output from qDebug() just read standard error: QProcess::readAllStandardError()

augusbas
24th September 2009, 11:54
qDebug() puts output on standard error so if you want to read output from qDebug() just read standard error: QProcess::readAllStandardError()


Thanks Buddy.. it worked