I bet that others came across this problem and that there is a very good general solution, however I have not been able to get this done.
In short: How to replace std::cout by something that writes in a dialog box without mixing my code with some monstrous class library such as in Qt4, or for Windows Microsoft's class libraries.
The details of this implementation should not matter for this question. The only thing that matters is that I've got a bunch of C++ classes and one function that uses all the methods in there to parse an input string according to a particular grammar, and spit out a new string (or several). Let's call it the pattern-machine, and it works just fine, so far. Before I proceed developing it, I want to make it part of a system that makes use of dialog windows. In particular, I want to use Qt4 (under Linux/Fedora but convertible to windows).
Reading around in the examples and tutorials, I find that Qt4 basically has it's own standard library, but now everything is called a Q-something, QString, QList, Qwhatever. The claim is that std-lib and Qt4 can all be mixed but how to convert objects between the two isn't clear at all: What if I don't even want to change any of my already developed include files, where all is based on the standard C++ library?
I implemented everything so far simply and exclusively using standard output via std::cout, and also file output. Currently I would like to just replace std::cout by something from a different system. I thought I could just include a reference of type ostream& in my class as a member and write everything to that object, but the compiler doesn't allow this, and I think I'm on the wrong path.
Eagerly awaiting pearls of wisdom......