There is nothing wrong with the line that you posted. How do you define your string?

Try something like this right above your qDebug() line.
QString s = "test";

If it doesn't help, please post more code.