You can set the codec for out to ISO 8859-1 (out.setCodec("ISO 8859-1")
).
Then you can write out << "Olá Mundo!" << endl;
But then out << QString("Olá Mundo!") << endl;
won't function anymore. This is just because the QTextStream operator<<(const char * string) expects a string in ISO 8859-1 and operator<<(const QString & string) a QString in UTF-8. The default codec for QTextStream is UTF-8.
qDebug converts the string internally into UTF-8. That's why you can write qDebug() << "Olá Mundo!";