PDA

View Full Version : How to Get Konsole Command Output?



Furkan
6th April 2010, 11:10
Hello Guys!
I've been trying to get the output of a konsole command output. (I'm trying to get Wget's output) I've tried QProecess, readyReadStandardError etc. But I couldn't get the result. Can anyone help me with that?
Thanks in advance!

wagmare
6th April 2010, 13:20
QProcess is a correct way ..

I've tried QProecess, readyReadStandardError etc. But I couldn't get the result
can u show us how u implement the QProcess

Furkan
7th April 2010, 06:52
QProcess process;
process.setProcessChannelMode(QProcess::MergedChan nels);
process.execute("wget http://27.media.tumblr.com/tumblr_l0d8uj2Ou41qbut2yo1_400.jpg");
process.waitForFinished();
QString str = process.readAll();

Also I tried the readyReadStandartOutput signal. But I couldn't get the Wget's output.

wysota
7th April 2010, 08:29
Do you mean "console" or "konsole" (as in KDE terminal emulator program)?

Furkan
14th April 2010, 19:57
I mean "Konsole".

wysota
14th April 2010, 20:16
In that case you can't. Konsole doesn't output what it displays. If you really need it you can tee (man tee) the output from wget to some file or named pipe and read it from there before it reaches Konsole.