[Qt-interest] About QProcess :How to read stdoutput realtime?

Princy K. V. princy.kv at nestgroup.net
Tue May 5 11:13:00 CEST 2009


Hi,

Thanks for ur reply.

But slot is not invoked when I used these signals
readyReadStandardError () & readyReadStandardOutput (

..so I used following code snippets, this consumes lot of
time..sometimes not getting desired output..

 

void CMainWindow::Run()

{

QByteArray byteArray;

byteArray.resize(2000);

byteArray.clear();

ui->plainTextEdit->setEnabled(true);

ui->plainTextEdit->clear();

while(!Start())

{

//progress->hide();

byteArray.clear();

byteArray=process->readAllStandardOutput();

ui->plainTextEdit->appendPlainText(byteArray);

}

}

 

void CMainWindow::Start()

{

.......

process->start("xx.exe" ,arguments);

if (!process->waitForStarted())

return false;

// ui->statusBar->addPermanentWidget(progress , 0);

if(!process->waitForFinished())

{

//progress->setMinimum(0);

//progress->setMaximum(0);

//progress->show();

return false;

}

......

return true;

}

 

 

 

________________________________

 

u are using this signals right ,



void readyReadStandardError ()

void readyReadStandardOutput ()

 

On Tue, May 5, 2009 at 1:04 PM, Princy K. V. <princy.kv at nestgroup.net>
wrote:

Hi,
 I m new to Qt.I want to display datas that are written on stdoutput by
an external process on my gui. I have started external process using
Qprocess. I can display all stdoutput data by calling,
byteArray=process->readAllStandardOutput();
ui->plainTextEdit->appendPlainText(byteArray);
But my reqiurment is to display data(line by line) same time it is
written on stdoutput.i have tried many methods.so far didn't get
required output..
Please suggest me some solutions..
Thanks..
***** Confidentiality Statement/Disclaimer *****

This message and any attachments is intended for the sole use of the
intended recipient. It may contain confidential information. Any
unauthorized use, dissemination or modification is strictly prohibited.
If you are not the intended recipient, please notify the sender
immediately then delete it from all your systems, and do not copy, use
or print. Internet communications are not secure and it is the
responsibility of the recipient to make sure that it is virus/malicious
code exempt.
The company/sender cannot be responsible for any unauthorized
alterations or modifications made to the contents. If you require any
form of confirmation of the contents, please contact the company/sender.
The company/sender is not liable for any errors or omissions in the
content of this message.
***** Confidentiality Statement/Disclaimer *****

This message and any attachments is intended for the sole use of the
intended recipient. It may contain confidential information. Any
unauthorized use, dissemination or modification is strictly prohibited.
If you are not the intended recipient, please notify the sender
immediately then delete it from all your systems, and do not copy, use
or print. Internet communications are not secure and it is the
responsibility of the recipient to make sure that it is virus/malicious
code exempt.

The company/sender cannot be responsible for any unauthorized
alterations or modifications made to the contents. If you require any
form of confirmation of the contents, please contact the company/sender.
The company/sender is not liable for any errors or omissions in the
content of this message.


_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




-- 
WAGMARE

***** Confidentiality Statement/Disclaimer ***** 

This message and any attachments is intended for the sole use of the intended recipient. It may contain confidential information. Any unauthorized use, dissemination or modification is strictly prohibited. If you are not the intended recipient, please notify the sender immediately then delete it from all your systems, and do not copy, use or print. Internet communications are not secure and it is the responsibility of the recipient to make sure that it is virus/malicious code exempt.
The company/sender cannot be responsible for any unauthorized alterations or modifications made to the contents. If you require any form of confirmation of the contents, please contact the company/sender. The company/sender is not liable for any errors or omissions in the content of this message.
***** Confidentiality Statement/Disclaimer *****  

This message and any attachments is intended for the sole use of the intended recipient. It may contain confidential information. Any unauthorized use, dissemination or modification is strictly prohibited. If you are not the intended recipient, please notify the sender immediately then delete it from all your systems, and do not copy, use or print. Internet communications are not secure and it is the responsibility of the recipient to make sure that it is virus/malicious code exempt.

The company/sender cannot be responsible for any unauthorized alterations or modifications made to the contents. If you require any form of confirmation of the contents, please contact the company/sender. The company/sender is not liable for any errors or omissions in the content of this message.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090505/74535d1b/attachment.html 


More information about the Qt-interest-old mailing list