I have a Qt GUI application running on Windows that allows command-line options to be passed and under some circumstances I want to output a message to the console and then
First of all you can try flushing the buffer
std::cout << "Hello, world!"<
For more Qt based logging you can try using qDebug.