Odd considering the same nearly the same code is in the addressbook tutorial
if (i == contacts.end()) {
nameLine->clear();
addressText->clear();
return;
}
if (i == contacts.begin())
i = contacts.end();
i--;
if (i == contacts.end()) {
nameLine->clear();
addressText->clear();
return;
}
if (i == contacts.begin())
i = contacts.end();
i--;
To copy to clipboard, switch view to plain text mode
Ok, nevermind.. I found the issue. Its not a bad iterator but bad iterator placement in the code. After looking at the above code segment I noticed MY placement of it-- was after calling for the information to post in the line edits. So should have read
it--;
ui->something->settext(it->variable)
it--;
ui->something->settext(it->variable)
To copy to clipboard, switch view to plain text mode
instead of
ui->something->settext(it->variable)
it--;
ui->something->settext(it->variable)
it--;
To copy to clipboard, switch view to plain text mode
Its always the stupid things you miss... Thanks for the info even though I didn't get a chance to read up on it before finding my blunder
Bookmarks