How to delete two consecutive line using an iterator??
I am trying to create a form to save user and password using QT3.3. But i also want to modify and delete the user name and password.I am able to delete the user name, but i am not able to delete the immediate next line.The code i have been using is:
QStringList::Iterator it;
it = qFind(lines.begin(), lines.end(), str);
if(it != lines.end())
{
lines.erase(it);
}
Can any one suggest any way?
QStringList::erase
returns an iterator that references the element that was behind the element you just erased, so:Also, obligatory: Is there a reason you use Qt 3.3? That's ancient by now.