I cannot print QString in Qt using QDebug.
Below are some attempts (no one is working):
QDebug(letters.toStdString()); QDebug(letters.toLatin1()); QDebug() << letters.toUtf8(); QDebug() << letters.toWCharArray(); QDebug() << letters.toStdString(); QDebug() << letters;
I turned on:
#include <QtDebug> #include <QDebug>
I am using Qt 5.2. I also added CONFIG += console to the project file
My mistake: "There is no suitable function to call QDebug :: QDebug ()"
I also got "QDebug (QByteArray) ambiguously" for QDebug(letters.toLatin1());
source share