Code: [全选] [Expand/Collapse]
- qDebug() << QString("hello") << "hello";
"hello" hello
解决方法1:
使用 qPrintable方法
Code: [全选] [Expand/Collapse]
- qDebug() << qPrintable(QString("hello")) << "hello";
解决方法:
// 测试
Code: [全选] [Expand/Collapse]
- qDebug() << qPrintable(QString("hello你好啊")) << "hello你好啊";
使用qPrintable会有乱码
解决方法2:qUtf8Printable
Code: [全选] [Expand/Collapse]
- qDebug() << qUtf8Printable(QString("hello你好啊")) << "hello你好啊";