QString desString = QString("%1").arg(srcNum,len,10,QLatin1Char('0')); srcNum为原数字,len表示转换后字符串长度,10表示a为十进制数,‘0’表示不足位数用0填充