Qt debug show line numbers

Viewed 257

I am a newbie programmer. Is there any way that I can print the File name and line number of my qDebug() output in Qt C++ code? Currently, I have to manually write the filename every time I output a debug message.

Please help

1 Answers

Please try the following

qDebug() << __FILE__ << __LINE__ << "Your message";
Related