AVR
Qt Code:
  1. for (int i = 1; i < sp_dataLength; i++) {
  2. sum += sp_recievedData[i];
  3. }
To copy to clipboard, switch view to plain text mode 
Qt
Qt Code:
  1. for (int i = 0; i < sp_dataLength; i++) {
  2. bytearray[0] = bytearray[0] + sp_ar_dataToSend[i];
  3. }
To copy to clipboard, switch view to plain text mode 
output
sp_recievedData[i] : 1, 10, 215, 35, 60
result sum: 65
result bytearray[0] : 65

bytearray[0] - is QByteArray same as dataToSend

1+10+215+35+60 = 321 - 256 = 65

May I ask you?
If so: why should I count it in integer if it is loss prevention protocol?

My question is replacement bytearray[0] by other variable, in QT, to operate BYTE. CHAR crush....

I can't say it other "clear" way.