PDA

View Full Version : how can we convert __PRETTY_FUNCTION__ to a QString



learning_qt
25th January 2010, 14:40
I hope to log each function name by using __PRETTY_FUNCTION__. But I do not know how to convert it to a QString. Please give some helps!

Thanks in advance!

faldzip
25th January 2010, 14:54
use Q_FUNC_INFO instead. It returns const char * and which is then automatically converted to QString when it is needed or you can convert it explicitly: QString(Q_FUNC_INFO)