Hello guys
What's wrong with the code below that messagebox displays empty string??
Code:
std::cout<<"bla"; qDebug()<<"ble"; line = stream.readLine();
Printable View
Hello guys
What's wrong with the code below that messagebox displays empty string??
Code:
std::cout<<"bla"; qDebug()<<"ble"; line = stream.readLine();
what is 'stdout' ? Please read my sig.
http://qt-project.org/doc/qt-4.8/qte...m.html#details
That's the example from Qt doc.
found it by myself,
http://www.cplusplus.com/reference/c...cstdio/stdout/
Added after 11 minutes:
maybe QTextStream doesn't know buffer has changed...
Code:
stream<<"bla";
I expect that works better...
That surely works better,but won't help with my goal,which is a Qt GUI program intercepting all what has been sent to standard out and error (ext std::cout << "some input";) then displaying that inside let's say QTextEdit.
stdout stands for "Standard Output". The example you linked to uses stdin, which stands for "Standard Input".
You can read from an input file handle and write to an output file handle, but only read/write from a file handle that has been opened for read and write.
Neither of the to standard handles has been opened that way.
You could start a wrapper program that uses QProcess to start the real program and read from the standard output of the child.
Cheers,
_