qt中qstring类的toint(0,0)是啥意思嘞,请教各位兄弟姐妹

最近看代码时遇到别人写的代码里有用到toInt(0,0)觉得不可思议,0难道可以当底数?

img

Qt文档里已经写得很清楚了。

int QString::toInt(bool *ok = nullptr, int base = 10) const

Returns the string converted to an int using base base, which is 10 by default and must be between 2 and 36, or 0. Returns 0 if the conversion fails.

If ok is not nullptr, failure is reported by setting *ok to false, and success by setting *ok to true.

If base is 0, the C language convention is used: if the string begins with "0x", base 16 is used; otherwise, if the string begins with "0", base 8 is used; otherwise, base 10 is used.

不看文档,方显俺才是老大