qt如何让Qstring里的字符串不识别转义
在Qt中,可以使用QString::fromUtf8()函数来将字符串转换为不识别转义的形式。例如:
QString str = QString::fromUtf8("Hello\\nWorld");
qDebug() << str; // 输出: Hello\nWorld
在上面的例子中,字符串中的"\n"被转换为了"\n"字符,而不是转义为换行符。
原文地址: https://www.cveoy.top/t/topic/bWM2 著作权归作者所有。请勿转载和采集!