QString MainWindow::hexTodec(QString strHex){//十六进制转十进制
int i;
int v=0;
for(i=0; i<strHex.length();i++)
{
v*=16;
v+=hex2(strHex[i].toLatin1());
}
return QString::number(v);
}
int hex2(unsigned char ch){//十六进制转换工具
if((ch>='0')&&(ch<='9'))
return ch-0x30;
else if((ch>='A')&&(ch<='F'))
return ch-'A'+10;
else if((ch>='a')&&(ch<='f'))
return ch-'a'+10;
return 0;
}