void MainWindow::readMyCom() //读串口函数
{
QByteArray temp =myCom->readAll().toHex();
//读取串口缓冲区的所有数据给临时变量temp
qDebug()<<"temp="<<temp;
ui->textBrowser->insertPlainText(temp);
//将串口的数据显示在窗口的文本浏览器中
j=temp.toInt();
qDebug()<<"j="<<j ;
..............
看到的数据是:
temp= "00"
j= 0
temp= "01"
j= 1
temp= "02"
j= 2
temp= "03"
j= 3
temp= "04"
j= 4
temp= "05"
j= 5
temp= "06"
j= 6
temp= "07"
j= 7
temp= "08"
j= 8
temp= "09"
j= 9
temp= "0a"
j= 0
temp= "0b"
j= 0
temp= "0c"
j= 0
temp= "0d"
j= 0
temp= "0e"
j= 0
temp= "0f"
j= 0
temp= "10"
j= 10
temp= "11"
j= 11
。。。。。。
为什么有a b c d e f,的数据都不能转换成10进制呢。。。。。。。。。。。。。