QtGlobal 常用函数
const char*Q_FUNC_INFO
Expands to a string that describe the function the macro resides in. How this string looks more specifically is compiler dependent. With GNU GCC it is typically the function signature, while with other compilers it might be the line and column number.
Q_FUNC_INFO can be conveniently used with qDebug().
展开为描述宏所在函数的字符串。这个字符串的具体外观取决于编译器。对于 GNU GCC,它通常是函数签名,而对于其他编译器,它可能是行号和列号。Q_FUNC_INFO 可以方便地与 qDebug() 一起使用。
For example, this function:
1 | template<typename TInputType> |
when instantiated with the integer type, will with the GCC compiler produce:
const TInputType& myMin(const TInputType&, const TInputType&) [with TInputType = int] was called with value1: 3 value2: 4
If this macro is used outside a function, the behavior is undefined.
1 | void QFuncInfo() |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Vinda's Blog!
评论