方式一:使用qDebug()输出

QString str("liyifeng");
qDebug() << str;
1
2
输出结果:"liyifeng"

QString str("liyifeng");
qDebug() << str.toStdString().data();
1
2
输出结果:liyifeng

方式二:使用std::cout输出

#include <iostream>

QString str("liyifeng");
std::cout << str.toStdString().data() << std::endl;
1
2
3
4
输出结果:liyifeng
---------------------
作者:qq598535550
来源:CSDN
原文:https://blog.csdn.net/qq598535550/article/details/60886051
版权声明:本文为博主原创文章,转载请附上博文链接!

相关文章:

  • 2022-12-23
  • 2021-12-25
  • 2022-01-15
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2021-06-29
  • 2018-09-14
  • 2022-12-23
相关资源
相似解决方案