Qt 字符串相等判断问题

QString str = "0";
if (QString(param.value.data()) == QStringLiteral(""))
{
    str = "0";
}
else
{
    str = "1";
}  

/* 这里 字符串比较可能会出现不一致的现象 可以尝试添加
QStringLiteral 修饰
*/


posted on 2023-02-27 11:06  掌控命运  阅读(185)  评论(0)    收藏  举报

导航