make a sub-function
for(QStringList::Iterator it
= list.
begin(); it
!= list.
end();
++it
) { if(name == *it) {
return TRUE;
}
}
return FALSE;
}
bool isNameExistInList(QStringList &list, QString &name) {
for(QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
if(name == *it) {
return TRUE;
}
}
return FALSE;
}
To copy to clipboard, switch view to plain text mode
then use this function at the time of insertion of strings
if(!isNameExistInList(yourList, "john_1") {
yourList.append("john_1")
}
and so on...
if(!isNameExistInList(yourList, "john_1") {
yourList.append("john_1")
}
and so on...
To copy to clipboard, switch view to plain text mode
Bookmarks