Hello friends I have to cut elements before transfer to DB:

My approach is

Qt Code:
  1. int i_fieldlength[]={4,2,4,40,8,6,5,3,8,1,5,3,7,8};
  2. for(int i =0; i < sizeof(i_fieldlength);i++){
  3. QString strbuf = splitlinelist.at(i);
  4. splitlinelist.at(i)=strbuf.left(i_fieldlength[i]);
  5. }
To copy to clipboard, switch view to plain text mode 

Is there a more elegant way or faster way to do this???

Ups this approach create an error:
Qt Code:
  1. sources\tableeditor.cpp|917|error: passing `const QString' as `this' argument of `QString& QString::operator=(const QString&)' discards qualifiers|
To copy to clipboard, switch view to plain text mode