template <class T> void RemoveListDup( QList <T> & lst ){ QSet <T> qs; int i, place = 0, limit = lst.size(); for (i = 0; i < limit; ++i) { T & val = lst[i]; if (qs.contains(val)) continue; qs.insert(val); if (i != place) lst[place] = val; ++place; } lst.erase(lst.begin() + place, lst.end());}
if (qs.contains(val)) continue; qs.insert(val);
if( qs.insert(val) != qs.end()) continue;