Qt qDebug() 的使用方法
来源:互联网 发布:js获取input 编辑:程序博客网 时间:2024/05/18 23:28
在Qt程序调试的时候,经常需要打印一些变量,那么我们就需要使用qDebug()函数,这种函数有两种使用方法,如下所示:
QString s = "Jack";qDebug() << "My name is " << s << ", nice to meet you!" << endl;qDebug("My name is " + s.toLatin1() + ", nice to meet you!\n");
其中第一种使用方法,qDebug()相当于c++中的cout,后面的使用规则都一样,下面那种有些类似C语言的使用规范,但是不同之处在于它也可以连接字符串,需要注意的是不能直接连接QString类型的,要用toLatin1()函数将其转为为QByteArray才行。
阅读全文
0 0
- Qt qDebug() 的使用方法
- [Qt][ubuntu 13.4]qdebug使用方法
- [QT]qdebug的使用方法 或者说 使用格式
- Qt:禁止qDebug的输出
- Qt:禁止qDebug的输出
- Qt中qDebug 的使用
- QT屏蔽qDebug的方法
- QT中qDebug的使用
- Qt中qDebug 的使用
- qDebug使用方法
- qdebug使用方法
- qdebug使用方法
- qdebug使用方法
- qdebug使用方法
- qdebug使用方法
- qdebug使用方法
- qdebug使用方法
- 【Qt】QDebug
- Python 爬虫(一)综述
- Android使用http协议访问网络
- 高德地图计算两点之间的距离java+html
- Myeclipse 自动添加注释
- Linux下安装和卸载补丁包
- Qt qDebug() 的使用方法
- 科技创新才能引领未来
- 小白Python3爬虫
- LSP剩余时间(Remaining Lifetime)
- Java
- Error:All flavors must now belong to a named flavor dimension. The flavor 'flavor_name' is ...
- 80. Remove Duplicates from Sorted Array II
- Minimum Moves to Equal Array Elements II
- 怎样为爱犬挑选合适的狗粮