You asking printf to treat an integer as a qint8, so what do you expect? Anything more than 0x7F will always be negative number.
Maybe this is what you meant:
Qt Code:
for (i = 0; i < byteArray.size(); i++) { printf("%02X\r\n", (quint8) byteArray[i] ); }To copy to clipboard, switch view to plain text mode
Note the quint8 instead of qint8
Bookmarks