I am trying to display a number using QDebug in the Hex format. Below is the code which I have written. It is working but the output has string contents enclosed in double quot
May be a little late, but in case someone needs this:
As statet in the answere by Kuber Ober, Qt only removes the quotes if it's a const char *
passed to qDebug
. However, Qt provides a macro to do the same with a QString
- The qPrintable
macro:
qDebug() << qPrintable(QString("String without quotes")) << QString("String with quotes");
This way, you can use the QString::number
function (as provided by TheDancinZerg) to format the string:
int value = 0xFFFF;
qDebug() << qPrintable(QString::number(value, 16));