Is there a way to implement a "stdout" type of widget in Qt, e.g., a textbox type window that either printf() output would go to (like a terminal) or sprintf() character buffers?
Printable View
Is there a way to implement a "stdout" type of widget in Qt, e.g., a textbox type window that either printf() output would go to (like a terminal) or sprintf() character buffers?
I think this might be helpful:
http://www.qtcentre.org/forum/f-qt-p...ghlight=printf
Check out qt-interest 2004-03. The last two messages have two different interesting solutions.
Hi,
I ran into a similar problem, but haven't found a working solution yet.
Under the hood of my Qt application I'm using a special purpose library were a cannot change the code. It uses printf() to output errors and warnings.
What I want to do is catch those printf's and print them into a QPlainTextEdit.
I need a solution for Windows and Linux.
On Windows I tried this:
Code:
// Create a pipe HANDLE hPipe = CreateNamedPipe("\\\\.\\pipe\\MyPipeNameHere", PIPE_ACCESS_OUTBOUND | WRITE_DAC, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_NOWAIT, 1, 1024, 1024, 2000, NULL); // let a SocketNotifier watch that pipe connect(notifier, SIGNAL(activated(int)), SLOT(outputReceived()));
But I don't receive anything on that slot.