Unsolved Problem with function that redirects std::cout to QTextEdit
-
I found this old Qt forum post that outlines a function to redirect std::cout to a QTextEdit.
http://www.qtforum.org/article/39768/redirecting-std-cout-std-cerf-qdebug-to-qtextedit.html
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,
http://stackoverflow.com/questions/10308425/redirect-stdcout-to-a-qtextedit
and that works perfectly. But obviously it is more inefficient.