I am tring to shift enter chararter by 2 . That mean char "A" to "c".

How it should work:
1> I collect QString from LineEdit.
2>Than get each ASCII value of SQtring
3> Add 2 to ASCII Value
4> Convert it to QString
5> Show it to Thru LineEdit2

Qt Code:
  1. QString pass3;
  2. QChar ch;
  3. int i,chValue;
  4.  
  5.  
  6. // Get Data
  7. QString str = ui->lineEdit->text();
  8.  
  9. // QString to char array;
  10. for(i=0; i<=str.size();i++)
  11. {
  12. // converted to number
  13. ch=str.at(i).toAscii();
  14. chValue = ch.toAscii();
  15.  
  16. chValue=chValue + 2;
  17.  
  18. // Number to Charecter and string in QSTRING
  19. pass3 += QChar(chVale);
  20.  
  21. }
  22.  
  23. ui->lineEdit_2->setText(pass3);
To copy to clipboard, switch view to plain text mode