It is not quite clear what you try to do here. Your code does not make sense: you can't send xterm 'some data' (looks like you want it to execute some command for you, here ls) to its standard input.
If you want the output of ls, simply do this:
QProcess proc;
proc.start("ls");
proc.waitForFinished();
qDebug() << proc.readAllStandardOutput();
If you want an interpreter running in the background, that you can send commands for it to execute (like a shell) you may do something like:
QProcess proc;
proc.start("/bin/sh");
proc.waitForStarted();
Q_FOREACH( QString cmd, QStringList() << "ls" << "date" << "echo test" )
{
proc.write((cmd + "\n").toLocal8Bit());
proc.waitForReadyRead();
qDebug() << proc.readAllStandardOutput().split('\n');
}
proc.write("exit\n");
proc.waitForFinished();