Hi ppl,

I need to convert a QString to a unsigned char array. I've already searched the forums & did some google reasearch but somehow failed to find a working solution

I had no probs to convert the QString to a normal char array:

Qt Code:
  1. QString str = "somestring"; // data comes from a db in my case
  2. int length = str.length();
  3.  
  4. char *sequence = NULL;
  5. sequence = new char[length+1];
  6. strcpy(sequence, str.toLocal8Bit());
To copy to clipboard, switch view to plain text mode 

i think the "unsigned" solution is also pretty simple, but somehow i can't figure it out???

please help...

thx