Qdebug在qt调试中的应用
来源:互联网 发布:有关人工智能的文献 编辑:程序博客网 时间:2024/06/04 00:58
void qDebug ( const char * msg, ... )
Calls the message handler with the debug message msg. If no message handler has been installed, the message is printed to stderr. Under Windows, the message is sent to the console, if it is a console application; otherwise, it is sent to the debugger. This function does nothing if QT_NO_DEBUG_OUTPUT was defined during compilation.
If you pass the function a format string and a list of arguments, it works in similar way to the C printf() function. The format should be a Latin-1 string.
如果向qDebug传递一个格式化的string和一个参数列表,它就跟C里面的printf()函数使用方法一样。
Example:
qDebug("Items in list: %d", myList.size());
If you include <QtDebug>, a more convenient syntax is also available:
包含的头文件为<QtDebug>时,支持如下面所示的语法形式。
qDebug() << "Brush:" << myQBrush << "Other value:" << i;
With this syntax, the function returns a QDebug object that is configured to use the QtDebugMsg message type. It automatically puts a single space between each item, and outputs a newline at the end. It supports many C++ and Qt types.
输出时,会自动的为每个变量中间添加一个空格,并且在句尾添加一个换行。
这种格式支持许多C++ 和Qt数据类型。
To suppress the output at run-time, install your own message handler with qInstallMsgHandler().
几个简单的例子:
qDebug()<<"create file success";
QString appDirPath = QApplication::applicationDirPath() + "/";
qDebug() << "Current appDirPath:" << appDirPath;
0 0
- Qdebug在qt调试中的应用
- qDebug调试基本应用
- qt 屏蔽qDebug调试信息
- Qt笔记_调试qDebug
- Qt在windows下在控制台用qDebug()输出调试错误
- 输出调试信息qDebug的应用
- 输出调试信息qDebug的应用
- Qt中的qDebug()像cout那样用
- 【Qt】QDebug
- Qt qDebug()
- qt中如何用qDebug输出彩色调试信息
- Qt调试信息分类和qDebug()导出到文…
- qt中如果用qDebug输出彩色调试信息
- 【Qt】qDebug()调试信息保存至txt日志文件
- qt中如何用qDebug输出彩色调试信息
- QT中使用qDebug()在VS下的设置
- 在VS下使用QDebug打印调试信息
- 问题:如何qDebug自己开发的运行在BlackBerry 10的Work Space中的企业应用呢?
- C++语言基础 例程 对象成员的引用
- C++语言基础 例程 类和对象的简单应用举例
- 一切成功源于积累——20150307 美国非农5分钟k线直至收盘 各货币对表现
- WCF系列_分布式事务(下)
- [leetcode]16 Valid Palindrome
- Qdebug在qt调试中的应用
- C#工厂模式-工厂方法
- android activity 传值
- 分类信息网站排名,终身VIP制-辛有才分类信息网
- Robotium中调用getActivity()方法导致程序挂起的研究浅析
- Y470 Y570 UEFI 2.12BIOS(64位)
- fatal error LNK1281: 无法生成 SAFESEH 映像。
- 优化多说插件的加载速度
- 1034_有理数四则运算(20)