Qt Code:
  1. /*qstring object/* newText = arg1;
  2.  
  3.   if(newText.size() > 0)
  4.   if(newText[newText.length()-1].isLetter())
  5.   {
  6.   for(int i{0}; i < vowels.length()-1; i++)
  7.   {
  8.   if(newText[newText.length()-1] == vowels[i])
  9.   {
  10.   newText[newText.length()-1] = vowels[i+1];
  11.   ui->lineEdit->setText(newText);
  12.   return;
  13.   }
To copy to clipboard, switch view to plain text mode 

vowels[i+1] indexes the last element of the Qstring, not the element one over from i. Why is this?
Also, is there a shorter way to reference the last element of a Qstring.