Sort QFileInfoList to handle file names that end with numbers
-
Currently if you have files that end in numbers, a QFileInfoList list created by calling dir.entryInfoList() appears in the following order,
test_1.txt,
test_10.txt,
test_11.txt, etcI want to sort a QFileInfoList so that it is number aware i.e the list is as follows,
test_1.txt
test_2.txt
.....
test_10.txt
test_11.txtAny help much appreciated.
-
If people are interested....I did some more searching and thinking and the way to do this is to use a qSort with a custom struct that enables a "Natural Sort",
http://stackoverflow.com/questions/11933883/sort-filenames-naturally-with-qt