//Qstring转int提供默认值,QT没有此功能函数,需要实现,qt的toInt()默认值为0
inline int ToIntDef(QString string, int defaults)
{
bool ok = false;
int iValue = string.toInt(&ok);
if(!ok)
{
iValue = defaults;
}
return iValue;
}
QT实现BCB的ToIntDef()函数:Qstring转int提供默认值,QT没有此功能函数,需要实现,qt的toInt()默认值为0
最新推荐文章于 2023-09-19 17:15:02 发布