方式一:使用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
版權聲明:本文為博主原創文章,轉載請附上博文鏈接!