Index out of range error
Unsolved
General and Desktop
-
In my qt c++ application when I insert a text value concatenated with a comma opeartor I get a runtime error stating "Index out of range"! But with out comma if I only insert the line edit value to the QStringList there is no runtime error!
Following code works
QStringList myList;
myList<<ui->lineedit1->text();but following gives a runtime error!
QStringList myList;
myList<<ui->lineedit1->text()+",";How can I correct this issue?
-
@Lasith by using the intended QStringList functions instead if an abstract and overloaded operator
QStringList myList;
myList.append(ui->lineedit1->text()+","); -
@Lasith are you sure it actually crashes at that line?
-
Hi
Normally its the
that can give "index out of range error"not when inserting ?
1/5