qt 比较两个字符串是否相等

QString str = QString::fromLocal8Bit("球形");
if(str.compare(QString::fromLocal8Bit("球形") == 0)
{

}


或者:
if(str ==QString::fromLocal8Bit("球形"))
{

}


猜你喜欢

转载自blog.csdn.net/qq_40110291/article/details/78133913