PDA

View Full Version : QProcess and reading data from xterm



sawerset
9th February 2009, 21:48
I sarts xterm from my program by using QProcess.
I need to send to xterm "tty" command and reads its output.
I try to do it a such way


terminalProc.start("xterm");
terminalProc.setReadChannel(QProcess::StandardOutp ut);

terminalProc.waitForStarted(-1);
terminalProc.write("tty\n");
QByteArray result = terminalProc.readAllStandardOutput();


But result is empty. What i am doing wrong?
Is there any other way to get value of tty?