This will seem to work fine too however is completely incorrect and some day when you least expect it will explode in your face
Absolutely agree, I've already experienced such situations. But here I don't see any reason for that, except local static QMutex that I am not sure work correct.

QString x = "abc";
printf("%s\n", x.toLocal8Bit().constData());
What is wrong with this code (just curious)?