[Qt-interest] query on QProcess

Chandru... sekarwagmare at gmail.com
Mon May 18 07:59:01 CEST 2009


you are using linux or windows ..?

 may be the xx.exe will have an improper buffer flush ...
 if linux try   " xx.exe  |  less"  and see if it takes exact time that
happens in qprocess stdOut() .....

On Mon, May 18, 2009 at 11:17 AM, Princy K. V. <princy.kv at nestgroup.net>wrote:

>  Hi,,
>
>  I have a query on QProcess..Plse see the code snippets below…
>
> The actual running time of xx.exe for a particular argument is 7
> minutes…But when  started from my qt application..it takes longer time,, and
> system become too slow,,cpu usage goes to 100 percentage…why is it so?? Is
> it due to memory leakage??
>
> Do I need to release memory allocated for Qprocess by using stmnt ‘ delete
> process’ or ‘delete this ‘ in destructor sufficient?Plse help…thanks in
> advance..
>
>
>
> void CMainWindow::Run()
>
> {
>
> process = new QProcess(this);
>
> connect(process, SIGNAL(readyReadStandardError()), this,
> SLOT(updateError()));
>
> connect(process, SIGNAL(readyReadStandardOutput()), this,
> SLOT(updateText()));
>
> connect(process, SIGNAL(finished(int)), this, SLOT(updateExit(int)));
>
> process->start("xx.exe" ,arguments);
>
> }
>
> void CMainWindow::updateText()
>
> {
>
> while(process->canReadLine())
>
> {
>
> QByteArray data = process->readLine(200);// The Application turns to not
> responding when a line is added to
>                               //listwidget..
>
>
>
>
>
> ui->listWidget->addItem(QString(data));
>
> QScrollBar *bar = ui->listWidget->verticalScrollBar();
>
> bar->setValue(bar->maximumHeight());
>
> ui->listWidget->setAutoScroll(true);
>
> ui->listWidget->scrollToBottom();
>
> ui->listWidget->repaint();
>
> }
>
> }
>
>
>
> Thanks & Regards,
>
> princy
>  ***** 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090518/a62b6b91/attachment.html 


More information about the Qt-interest-old mailing list