Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Problem with function that redirects std::cout to QTextEdit
oracle3001 last edited by oracle3001
I found this old Qt forum post that outlines a function to redirect std::cout to a QTextEdit.
However, I found that if you have something like the following, it doesn't redirect the variable value (unless you recast explictly to a string) and so in the textbox all you get is "Test".
int i = 0 ;
std::cout << "Test" << i << std:endl ;
Any ideas why it isn't redirecting the variable value?
I am aware there is an older incarnation of this idea here,
and that works perfectly. But obviously it is more inefficient.