Qt 十六进制的简单应用, 十六进制的加法
1. 十六进制转为十进制
int QString::toInt(bool *ok = Q_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 a conversion error occurs, *ok is set to false; otherwise *ok is set to true.
If base is 0, the C language convention is used: If the string begins with “0x”, base 16 is used; if the string begins with “0”, base 8 is used; otherwise, base 10 is used.
bool ok;
QString hex = "100";
int dec = hex