Is there any easy way to get the following work? I mean is there any helper class in Qt
which prepares the string for qDebug
?
QString s = "value";
qDebug("abc" + s + "def");
You can use the following:
qDebug().nospace() << "abc" << qPrintable(s) << "def";
The nospace()
is to avoid printing out spaces after every argument (which is default for qDebug()
).