You want the string but in your cycle the 'i' of the integer. Why do not you pay attention to this(index = i)? Try compile the app? If yes, the compiler would inform you about it.
From your profile it seems that you are using Qt too several months. But it does not seem to be at all.
Do not try to conquer the peak, learn to walk first.