c++ - Reducing QListView to the common elements in the list? -
is there methode or simple approach this?
given list with:
d b b c d d
i want list reduced to:
a b c d
otherwise write process in background.
it depends on how data storen , passed view. generally, simpliest way remove duplicates list of element converting set:
qstringlist values; //... qset<qstring> set = values.toset();
after can convert set list using tolist
or iterate on set using usual foreach
loop. note qset
unordered. if want sort strings, convert set list , sort list using qsort
.
Comments
Post a Comment