Hello frenz i had a doubt in searching a string in QByteArray, i wanted to actually find the start of the frame "1A2C110000" and then append data from there all the data before the start of the frame to be discarded.. i think the only the index position of the first search string is taken so i am not getting the right out put.
Qt Code:
  1. QByteArray data = (QByteArray::fromRawData(buff,numBytes)).toHex();
  2. QByteArray edtdata(data);
  3. QByteArray serstr("1A2C11000000");
  4. edtdata.indexOf(serstr);
  5. for(int i=0; i <edtdata.size(); i++)
  6. {
  7. newdat.append(edtdata.at(k));
  8. }
  9. textBrowser->append(newdat);
To copy to clipboard, switch view to plain text mode 

this is a part of the data i am getting through rs232 terminal. .. i need to search for the start of the frame 1A2C11000000 and append the from there all the data before should be discarded. . i don't know exactly go about it. ..?

Qt Code:
  1. 1A2C1100000d110a110a110a110a110a110a110a110a110a110a110a110a11
  2. 1A2C1100000e110a110a110a110a110a110a110a110a110a110a110a110a110a110a11
  3. 1A2C1100000f110a110a110a110a110a110a110a110a110a110a110a110a110a110a11
  4.  
  5. 1A2C11000000 110a110a110a110a110a110a110a110a110a110a110a110a110a110a11
  6. 1A2C11000001110a110a110a110a110a110a110a110a110a110a110a110a110a110a11
  7. 1A2C11000002110a110a110a110a110a110a110a110a110a110a110a110a110a110a11
  8. 1A2C11000003110a110a110a110a110a110a110a110a110a110a110a110a110a110
To copy to clipboard, switch view to plain text mode 
does anyone have a idea of it. ?
thank you