How can i prepend the string in the list of string?
-
I have a list QList<QString>list;
Initially i have inserted some string in the list, afterwards i want to prepend some data in the each string in the list. I have tried the following code but getting error
@
for (int count = 0; count < list.size (); count ++) {
list.at (count).prepend (temp_string);
}
@How can i achieve it?
-
[quote author="KA51O" date="1331644359"].at(index) returns a const reference you need to use the [index] operator if you want to change the returned data.
@
for (int count = 0; count < list.size (); count ++) {
list[count].prepend (temp_string);
}
@[/quote]Thanks now it is working.