[Qt-interest] query on QProcess
Princy K. V.
princy.kv at nestgroup.net
Mon May 18 07:47:41 CEST 2009
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090518/151f2f1a/attachment.html
More information about the Qt-interest-old
mailing list