Tanny007
12th April 2012, 01:40
Hello,
I am a newbie in qt development and i want to transfer the output of QProcess to a textBrowser in real time. I started by executing a simple echo command,but the output of the program is not getting displayed.
What am i doing wrong????
QProcess p;
p.start("echo", QStringList() << "hye");
p.waitForStarted();
QByteArray byteArray = p.readAllStandardOutput();
QStringList strLines = QString(byteArray).split("\n");
QString line= p.readAllStandardOutput();
if(p.state()==QProcess::NotRunning)
ui->textBrowser->append("not running");
ui->textBrowser->append(line);
p.waitForFinished();
I am a newbie in qt development and i want to transfer the output of QProcess to a textBrowser in real time. I started by executing a simple echo command,but the output of the program is not getting displayed.
What am i doing wrong????
QProcess p;
p.start("echo", QStringList() << "hye");
p.waitForStarted();
QByteArray byteArray = p.readAllStandardOutput();
QStringList strLines = QString(byteArray).split("\n");
QString line= p.readAllStandardOutput();
if(p.state()==QProcess::NotRunning)
ui->textBrowser->append("not running");
ui->textBrowser->append(line);
p.waitForFinished();