User Tools

Site Tools


my_debug_output_macro

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

my_debug_output_macro [2017/02/09 11:30] (current)
xylene created
Line 1: Line 1:
 +This is not a criticism of Qt, in fact it has excellent debug output support.
  
 +I use Qt Creator and I've always found it slightly frustrating that I can't just click on a line of debug output to be taken to the source line that wrote it.
 +
 +<​code>​
 +#define here (qDebug().nospace().noquote() << "​file:///"​ << __FILE__ << ":"​ << __LINE__ << ":"​ << __FUNCTION__ << ":"​).space()
 +</​code>​
 +
 +This macro outputs to qDebug as you would expect but outputs the file and line from which the debug output came.
 +
 +When this is output to the "​Application Output"​ panel in Qt Creator it is parsed in such a way that I can now just click on the line of text in the app output panel and be taken to that line of source.
 +
 +This is especially useful for cleaning up code before release!!!
my_debug_output_macro.txt ยท Last modified: 2017/02/09 11:30 by xylene