Hi.
I'm working on a plugin for a 3rd party Qt application.
I can access the qApp and I also have a pointer to the QMainWindow of this application.
I successfully managed to redirect stdout to a file by using this code:
freopen("C:\output.txt", "w", stdout);
freopen("C:\output.txt", "w", stdout);
To copy to clipboard, switch view to plain text mode
But how can I redirect stdout to a QTextEdit or QPlainTextEdit widget?
I tried to do it using the QDebugStream method but it only printed to the QPlainTextEdit when I was explicitly calling cout<<"test"<<endl;
The QApplication itself still continued printing into the console window.
I also thought about reimplementing qInstallMsgHandler but somebody told me this is only for qDebug and not for stdout.
Maybe this can be done using QTextStream?
By the way I'm using Windows.
Thanks for any help!
Bookmarks