Hello
Because every element of stringData is a char, one way of solving the problem might be the following.(I presume that there is a space between each pair of char substring. In case there is no space, you should be able to pick two chars at a time from the tempArray and convert them to byte(integer)
QByteArray tempArray = stringData.toLatin1();
QList<QByteArray>qbList = tempArray.split(' ');
QByteArray dataBytes;
dataBytes.reserve(qbList.count());
int dbIndex = qbList.count() - 1;
bool ok;
for (int i = 0; i < qbList.count(); i++, dbIndex --) {
unsigned char c;
c = qbList.at(i).toUInt(&ok, 16) & 0xff; dataBytes[dbIndex] = c;
}
for (int i = 0; i < dataBytes.count(); i++) {
printf("0x%02x\n", dataBytes[i] & 0xff);
}