int a=9
QString ss=QString("%1").arg(a,2,10,QLatin1Char('0'));
结果:ss=09
//十六进制转十进制
bool ok;
QString hex = 16;
int dec = hex.toInt(&ok, 16);
//十进制转十六进制
int dec = 100;
QString hex = QString("%1").arg(dec, 4, 16, QLatinlChar('0')); // 保留四位,不足补零