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????

Qt Code:
  1. p.start("echo", QStringList() << "hye");
  2. p.waitForStarted();
  3. QByteArray byteArray = p.readAllStandardOutput();
  4. QStringList strLines = QString(byteArray).split("\n");
  5. QString line= p.readAllStandardOutput();
  6. if(p.state()==QProcess::NotRunning)
  7. ui->textBrowser->append("not running");
  8. ui->textBrowser->append(line);
  9. p.waitForFinished();
To copy to clipboard, switch view to plain text mode